Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

GC alloc all memory of machine

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a problem com my aplication. My application has 100 thread that use many cache. The problem is that after that aplication consume 4GB, the machine alloc memory until have no more memory in the machine. The aplicarion no exit e no get OutOfMemory, but run using 7,9 GB de memory. The problem is that the command top show that aplication consumed 4G, but has 7,9 GB de memory alloc. No has any more process in the machine.
The memory swap no is used in no moment and the gclog.txt show gc corrects.
I think that has any bug with the GC.

What is the error ??

Thanks

Information:
- The machine has 8GB RAM and 16GM de swap.

- Start my aplication stand-alone with:

java -verbose:gc -jar -Xms4048M -Xmx4048M -XX:NewSize=512M -XX:MaxNewSize=512M -XX:+PrintGCDetails -Xloggc:gclog.txt extractor.jar >> saida.txt &

- The machine is Linux and the version de jdk is:
java version "1.4.2_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_10-b03, mixed mode)
 
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I would not tweak memory parameters unless you know precisely what you are doing and have hard proof of before and after improvements. The exception is the ceiling:

-Xmx2048

I believe that is the maximum the 1.4 JVM can handle and even if it's not your GC will be seriously bogged down with a 4G heap. Keep it at 2Gs, then fire up another JVM in parallel if you need more memory/processing power.

The other common reason for OOME is permanent memory exhaustion. That is where class information lives so if you have a lot of classes loaded you can exhaust that. You should VERIFY that using the memory monitor available with 1.4. You should watch the permanent memory block under load. Make sure you have 16 megs or so of headroom. The default permsize is 64m for serer mode.

-XXMaxPermSize:...

BTW, are you CERTAIN your cache is flushing old content and recycling memory?
[ February 24, 2006: Message edited by: Rick O'Shay ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To study the memory usage in GC, as well as how your application works, this includes Servlet and Server-Side JSP scripting. You may consider to enable the JConsole JMX port in your application server, and start-up JConsole to monitor the detailed behaviours of your applications.

JConsole is one of the great memory diagnostic tool which bundled together with JDK :)

 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Warm Ice wrote:



Welcome to the Ranch.
Please check your private messages for an important administrative matter.
 
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
Warm Ice, please note that the topic you are responding to is three and a half years old. I don't think the original poster is still waiting for an answer - please don't wake the zombies.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic