This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Memory optimization tips needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Memory optimization tips needed" Watch "Memory optimization tips needed" New topic
Author

Memory optimization tips needed

landon manning
Ranch Hand

Joined: Nov 20, 2000
Posts: 47
Basic problem: My java program is using too much memory.
Does anyone have any good memory optimization tips for java?
On a related note, does anyone know the amount of memory that some of the more common Objects use? (ie. Strings, Integers, Threads)
Thanks
Landon Manning
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Use StringBuffer to do all your String concatinations.
On the size, I can only speculate. You can use Runtime.freeMemory() before and after creating an object to help determine this information if you want.

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Memory optimization tips needed
 
Similar Threads
MIDP java code optimization tips
garbage collector
String Literals memory management
Control Digital Camera
Limit of Memory size