Basically I had normal Swing GUI, which always takes 20MB of memory, as always I wanted to reduce memory overhead.
I also decided I wanted to make my app less resource demanding by only updating it 50fps.
So I stuck it in a loop and I set “setIgnoreRepaint(true)” and only manually repainting it every 50 frames.
This yielded a substantial improvement in Swing’s responsiveness(This was a surprise because to me Swing was already very responsive) and a 3MB reduction in memory, now standing at 17,100KB of memory under Window’s task manager.
It’s obvious what the issue is; Java2D, and not Swing, is the cause of some overhead in Swing apps.
While others have known Java2D was responsible for Swing’s bad name, I never did get any numbers of how large the overhead was.
Can I assume the Java2D team already knows about this overhead?
If you want to test this, do as I’ve done; grab a swing app, and manually repaint it by calling myFrame.repaint() for every 50fps.
Check both times the memory it takes and note the responsiveness.
System specs:
A64 3000+, 1GB DDR400 RAM, nForce 3 mobo and a Radeon 9700 Pro 128MB card.