• 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

OutOfMemoryErrors and the native heap

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got an application that was started with mx512m. My understanding is that this limits the JVM heap to 512MB of space. While watching the actual java process (using top) I am seeing the memory usage for the process go up to over 1GB of memory. Once the memory gets this high I start seeing java.lang.OutOfMemory errors.

One of the packages I'm using seems to be using the File.deleteOnExit() method. A bug on Sun's site indicates that this method causes native heap memory leaks. I can understand that that would cause my process memory to go up but would it cause OutOfMemoryErrors?.

I thought that the OutOfMemoryError meant that I didn't have anymore JVM heap space left (limited to 512mb in my case). Is it possible that I'm seeing the OutOfMemoryError due to the size of the native heap?

Thanks.

_M_
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you monitored garbage collection to see how frequent it is being performed? OutOfMemoryErrors can be caused any time garbage collection (assuming it ran) fails to re-allocate enough memory to continue.

I'd run your application through a 3rd party profiling tool and monitor memory allocation and use. The memory leak could be coming from anywhere.
 
Mike Noel
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like that's what I'm going to have to do. My problems seem to revolve around the apache commons FileUpload package so I may have to dig into that code too.

_M_
 
I've never won anything before. Not even a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic