• Post Reply Bookmark Topic Watch Topic
  • New Topic

out of memory prevention  RSS feed

 
Brandon Broschinsky
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program that allows users to edit photographs, and save them. I store the edited photos until the user save them, once saved i write them to disk, but still retain in memory what the user has been working on. It is very memory intesive. I wondering if anyone has any tips or suggestions on how to manage multiple images, and the available memory. Basically trying to prevent crashes. I could save everything to disk more often and read from disk but I would prefer not to if anyone has any suggestions it is appreciated.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default, the JVM (on Windows) doesn't allocate more than 64 MB memory. If you need more, start your program with the -Xmx command line switch. For example:

java -Xmx256m com.mypackage.MyProgram

This will allow the JVM to allocate up to 256 MB memory.
 
Brandon Broschinsky
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply, I know that I can increase the memory to the jvm, and I will probably do that, but I would still like to use as little memory as possible and suggestions or ideas on how to do that would help.

Thanks for your reply.
 
Alfonso Franco
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brandon I'am programmer java with other ides please go to visit to download its little images as the high too is at http://java.sun.com/products/java-media/jai/index.jsp . if need other something with java please contact me soon.

Thanks Alfonso Franco.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!