• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

out of memory prevention

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic