Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's Normal?

 
Rob Acraman
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • 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?
 
Laurent Leonard
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • 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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic