Memory comsumption and garbage collector
Hi all again,
I created a class extending Form. It sets a BorderLayout with:
- Container with BoxLayout(X) on NORTH [two Labels inside this container]
- TabbedPane on CENTER [a tab with a TextArea, the other with a Label]
I also add a Command, pretty simple.
I was monitoring memory usage on WTK2.5.2 and observed something strange to my understanding: By just moving the focus from a tab to another and viceversa the memory used grows extremely fast. I looked at the profiler and see that LWUIT doesn't seem to be making any calls to System.gc().
I attached a picture with the memory monitor and the emulator screen. Notice that memory arrived till almost 2 mb before garbage entered on stage. And I was just moving from a tab to the other. If I call the garbage collector trough memory monitor, all unused memory is released. That means this memory was allocated for nothing? Just for repainting and because no System.gc() calls were made??
If you look at the graphic in memory monitor, the highest peak is accomplished by only moving between tabs. Any info on LWUIT garbage collection? Does it relay on automatic calls? Should we make use of direct calls to System.gc()?