jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes What's Normal? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What Watch "What New topic

What's Normal?

Rob Acraman
Ranch Hand

Joined: Dec 03, 2000
Posts: 89
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

Joined: May 15, 2001
Posts: 35
Here is an interesting article :
Laurent Leonard
[This message has been edited by Laurent Leonard (edited September 19, 2001).]

I agree. Here's the link: http://aspose.com/file-tools
subject: What's Normal?
It's not a secret anymore!