• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

50 MB RAM normal for 1500 lines of code?

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!!!
Do mean the Interface "Destroyable"? I will try it, thanks a lot!
 
Beauty is in the eye of the tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic