add absmax memory saving function