-
Notifications
You must be signed in to change notification settings - Fork 16
DM-10370: Optimize server memory usage for fits images #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Server memory size cut in half - Optimized drawing so that user sees working message - Optimized scrolling so the it does not block when loading images - beta value (used for asinh strech) now only computed when required - added a getBetaValue service call - Uploading fits files now show masking while uploading - removed addColorBand call from server (not used) - Added way to push out memory in cache before large data is read in - Fixed bug in computing in CsysConvert.pointInPlot with rectangular images
@@ -59,9 +64,13 @@ | |||
else { | |||
Fits fits= null; | |||
try { | |||
if (memCache != null) { | |||
memCache.put(key, new ObjectSizeEngineWrapper.BluffSize(fitsFile.length())); | |||
memCache.put(key, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not quite understand what it is doing here? Why the same key was put twice with different value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I am clear space in the cache before I actually read the file. If there is a 5G file in the cache by doing this I can potentially push out the 5G from the cache before the 5G file is read. Since the act of reading would takes 10G we would go as high as 15G. With this change it will only go as high as 10G the down to 5G.
To summarize- replace a 5G file in cache:
before:
5G => 15G => 5G
after
5G => 10G => 5G
The ObjectSizeEngineWrapper.BluffSize
object appears to the cache to be big but it is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files I looked at looks fine. A very clean and transparent solution.
sharedManager = CacheManager.create(sharedConfig.getAbsolutePath()); | ||
try { | ||
System.setProperty("net.sf.ehcache.sizeofengine.shared.VIS_SHARED_MEM", | ||
"edu.caltech.ipac.firefly.server.cache.ObjectSizeEngineWrapper"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using ObjectSizeEngineWrapper.class.getName() here would be even cleaner. It will fail on setProperty so clearing it is not necessary. It'll also help find/refactor class when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look very good to me.
DM-10370: Optimize server memory usage for fits images
This is a very difficult test it requires jconsole to monitor the memory with large fits images. It could take awhile just to get set up. Mostly the review should just look over the code.
Target code to look at:
@loitly would you look at: