Click to See Complete Forum and Search --> : Memory management of Windows-environment using Java


oyvind
August 2nd, 1999, 06:09 AM
I am designing a video player in Java, and the playback rate has top
priority. I have 128MB RAM in my PC which is running Win95, and I am using
Java1.2/2.0. The screen size is 352x288 (CIF-format, 4:2:0), and my
sequences are typically 150 frames long.

So far I have tried to run several verisons of this player as a java-applet, and java application and they all seem to start
thrashing a lot in the beginning, and then if I leave the playback of a
sequence in an eternal loop, memory seems to be gradually freed from RAM
(The java-application actually runs out of memory at 125 frames - any hints on how to increase the cache for a java application?). At the
fifth or sixth run-through I may get a complete playback at the correct
frame rate.

Another option I have tried is to buffer up all the frames in RAM before
they are shown on screen (using amongst other things Java's MediaTracker
class). This has almost negligible effect as the array where the frames are
stored is partially swapped to disk, and I have the same problem as before.

All the above has been tried immediately after the machine has booted, with
no other programmes running. According to my calculations, a CIF sequence
with 150 YUV frames in a 4:2:0 format should take use just over 15MB of
memory. If the player is run as an applet, I am aware of the extra memory
usage, but does the browser together with the Win95 really need (more than)
113MB to run this thing smoothly? Could anyone please explain to me how the
memory management works in Win95 and how it could be controlled from Java?