• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

What's Normal?

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,
Coming from a C++ background, I was sitting down to write an app with several JFrames when I suddenly thought "If I declare these JComboBox, etc references static, then they won't eat up memory every time the screen is called" (where the options will always be the same every time).
Naturally, in C++, I can control when memory is grabbed and freed, so maybe I'm being a bit paranoid about Java filling memory and my not being able to control garbage collection.
So, are there any rules of thumb out there for memory control? OK, if you're iterating 1,000,000 times round a loop, use StringBuffer for String operations, but is memory management an issue outside of that?
and does anybody declare Components static?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is an interesting article :
http://developer.java.sun.com/developer/technicalArticles/ALT/RefObj/
------------------
Laurent Leonard
Laurent.Leonard@advalvas.be
[This message has been edited by Laurent Leonard (edited September 19, 2001).]
 
reply
    Bookmark Topic Watch Topic
  • New Topic