• 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

objMyObject = null and then System.gc

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

I am getting an issue of
java.io.IOException: java.lang.OutOfMemoryError: GC overhead limit exceeded

I am running a program which makes around 1000 Object in two second.

Should i assign objMyObject = null and then call System.gc

Is this correct way to do that?

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

Azrael Noor wrote:
I am running a program which makes around 1000 Object in two second.


Can we have a look at that?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Azrael Noor wrote:Should i assign objMyObject = null and then call System.gc
Is this correct way to do that?


No.

The correct way is to find out what the problem is first; then worry about how you solve it.

Winston
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you keeping references to all these objects?

Bill
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you manage to get those two Exceptions together?
How much memory have you got? How large are those objects?
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just giving brief about program

Queuebrowser.hasElements
{
objFileconnection = new FileConnectionClass(randomFilegenerator)
objFileConnection.saveFile(Queuebrowser.element.getText())
}


Queue browser have 42Thousand messages (varient sizes) and need to save in file or other Queue.

13 Thousand messages moved very fast but when it comes above that program got .....

Now i have increased memory of Queue Provider and also my program to 1 GB both :P

is that fine way?
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
-vmargs "-Xms512m -Xmx1536m -Xloggc:d:/gc.log"

This what i used to start Queue Provider.

Now looking what should i give to my program

When i check CPU usage it become 18% and memory is around 900 MB for java in which MessageQueue, Netbeans are running sidewise
 
Winston Gutkowski
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Azrael Noor wrote:is that fine way?


No.

You clearly didn't read my first post. Find out what the problem is.

All you've done is throw memory at it, which is not solving it. It may work for a while, but eventually you'll run into exactly the same error again.

One more time: Solve the problem.

Winston
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic