• 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

why my program throw the OutOfMemeory

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my program(is a monitor program).
after it run 6 hours ,it throw the Error of OutOfMemory.but when i see the system memory ,there are a larger memory not used. and how can I solve this problem and use the memory that not used.let it run a longer time?thanks!!!
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though you have free RAM, the JVM may not have access to it. You can increase the JVM heap size by giving certain parameters.
For example,
java -ms64M -mx128M example.MyClass
starts the JVM with an initial heap size of 64 megabytes and gives it permission to grow up to 128 megabytes. The JVM will not exceed the mx-value.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, almost forgot.
The fact that your program slowly runs out of memory implies a "memory leak" in your code. I'd suggest double-checking all code that deals with collections of some sort and ensure that references are nullified as intended.
 
Dingcheng lee
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear Lasse Koskela ,thanks a lot!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic