Hello developers at Nokia!
As I have found out every call to getResourceAsStream() wastes as much system memory as was the size of the resource. This piece of memory is not released until the whole MIDlet stops.
This bug exists on the 7650 (4.45) and 3560 (2.50) but not on the 7650 (3.xx). So it seems that it has been introduced into the codebase only recently.
The problem also causes a call to createImage(String name) to lose as much memory as was the size of the .PNG. (obviously createImage() internally just calls getResourceAsStream()).
I could not find a workaround for this problem. My application needs to load/release images quite often and also runs a very long time. So with this bug still present the programm eventually will run out of memory.
Possibly the only thing to do is to never release binary data of the .PNG and create the actual image from this data on demand.
The drawback of the solution is of course that I finally have all .PNG in memory _twice_ (once because of the leak and the second time because I may not release the data since every subsequent read would again leak memory).
As long as this bug is not fixed, big long-running applications (in the style of "legend of zelda") are nearly impossible.
So please, please do something about it soon,