Re: high memory consumption (IntIntHashMap)

Posted by Sven Gothel on
URL: https://forum.jogamp.org/high-memory-consumption-IntIntHashMap-tp2626543p2636570.html

On Friday, March 04, 2011 17:14:15 gouessej [via jogamp] wrote:
>
> I'm investigating, it seems to come from GLStateTracker:
> http://forum.jogamp.org/file/n2634263/highMemoryConsumption_IntIntHashMap.png 
>

Please review this change .. (the more the merrier)
  http://jogamp.org/git/?p=jogl.git;a=commitdiff;h=a167589233db343ac22b761d30d9dcd73016fe54

Inspecting the code, I realized that popAttrib() even has overwritten the current
client pixel-store state if it's corresponding pushAttrib() didn't happen with CLIENT_PIXEL_..
Which was IMHO a semantical bug .. and should be visible in applications push/pop a lot
with different bitmasks, where the pop would errorneous overwrite the pixel-store state.

This also removes the unnecessary IntIntHashMap creation on popAttrib() at all,
if this was the case of your test case memory peak.

Would be actually nice to have your test case at hand ..

However, pls review my code change - thank you.

~Sven