File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Memory optimization tips needed

 
landon manning
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic