Hi! I have a program with 1500 lines. There are some JPanels(6 or more), 3 threads, a mySQL and ftp connection, a comlex dialog and a property file. If I start my prog it uses 15 MB. 1. When I use my program with all functions it needs 50 MB. I think that is to much for small program. 2. When I minimize the program in the task bar (Windows) and maximize it again, it takes only 6 MB RAM. It shrinks from 50 MB to 6 MB. How is this possible? Thanks ! Bye
There is IMHO many reason for it ! The most likely one is that you do not de-allocate the Objects as it should. Basically you should nullify all the references you have when you don't need them !
All your class can then implement the interface like this :
You basically don't need to call on System.gc();, it will be OKAY w/o that ! By doing that you basically reduce the length of chains of unreferenced objects making the job of the GC easier ! There is on IBM alpha work a very good article about that ! You may also reduce the amount of memeory a program is allowed to use with the java -X options ... Yrs, [ April 20, 2002: Message edited by: Thomas SMETS ]