• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutOfMemmory Error

 
Venkatesh Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:

I a trying to create a XML file of size ranging from 50 - 200 MB.As I read the database and start building the XML Elements I get OutOfMemmoryError.

Can anyone shed some light on the cause of this error and a way to get around it ???

Thanks
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you give your JVM enough memory when you started it?

java -Xmx250M
 
david lightman
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is a very interesting post. I have read that a normal JVM for the appserver, let's say Websphere application server, should be set at 512MB. But if the box has lets say 6 gig of ram and your app needed to build large objects from a DB, wouldn't you need to allocate way more than 512? I mean, what if you were using connection pooling, so severeal EJBs were working concurrently on building large objects. What is the largest JVM size anyone has seen?
 
Senthil Somasundaram
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
david,

What is the largest JVM size anyone has seen?


This truly depends on your RAM availability and how many application server instances you have(Which shares the RAM )on that machine.

We are using 512 MB.

cheers,
Senthil
 
S Venkatesh
Ranch Hand
Posts: 464
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,

Use this JAVA_OPTIONS and MEM_ARGS.
This enforces GC and gives ur JVM enough space.
Please note that the values depend on your RAM size.

set JAVA_OPTIONS=-XX:NewSize=400m -XX:MaxNewSize=800m -XX:SurvivorRatio=8 -XX:MaxPermSize=300m -Xcompactgc -XX:+UseParallelGC

set MEM_ARGS=-Xms1000m -Xmx1200m

Hope this works for you.

Regards
Venkatesh S
 
Mayuri Roi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have used 2GB for JVM max heap for Websphere 6 on AIX box. Found drastic improvements in performance. Didnt notice any problems with GC.
We have 9GB physical RAM available.
 
david lightman
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree, if your application is basically a WAR, 256MB for the JVM may be fine. However, an EAR that contains several MDB's/EJB's that concurrently service high volume queues and make calls to a database that can return 10,000 records each that are then build in a collection and distributed back to a client would obviously need ALOT more heap. I understand why you use 2gig JVM(use EJB's too?). alot of system admins do not understand that it is the system RAM/ application that should dictate this, not a cookie cutter standard.
We had severall issues on a prototype, yes getting the infamous outOfMemory exception, and we are currently workig towards:
-raising the JVM heap to at least 1.5 gig
-clustering WAS instances allowing us to lower the number of connection pools for the MDB's/ stateless Session bean(that use MQ) and JDBC pool Intern cluster

it takes alot of performance testing and probr moitoring to configure this

any thoughts?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic