uci-sdcl/CalicoClient — Issue #68: Memory leak when drawing menu bars
Author: waynehuang3
Created: 2012-02-22 01:32:50+00:00
State: open

There is a memory leak in calico.components.CCanvas.drawMenuBar() that causes a
Exception in thread "InputQueue" java.lang.OutOfMemoryError: Java heap space

This issue stacks every time drawMenuBar() is called, whether it is due to LOST SYNC, or you just spam the clear canvas button. On machines with large amounts of memory, you may not notice any problems, but your heap size will grow dramatically (java.exe in task manager). However this is a huge issue for lower spec'ed machines (eg. tablets) because the OutOfMemoryError causes many problems (although the application does not stop).

The reason for this is that the line
"canvas.getCamera().removeChild(this.menuBarLeft);"

should probably be
"toolLayer.removeChild(this.menuBarLeft);"

I've tested that this solution solves this particular issue, however I would like to verify whether or not the menu bar item should still be removed from the canvas camera.