• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutofMemoryError

 
Sandeep Kumar S Jakkaraju
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

My midlet stops giving this OutofMemoryError.....
I have several Threads running in infinite loop ..I am making all the objects i create ..null after every iteration ...
Still I think the Garbage Collector is not destroying all the objects...!!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sandeep Kumar Jakkaraju:
Hi All

My midlet stops giving this OutofMemoryError.....
I have several Threads running in infinite loop ..I am making all the objects i create ..null after every iteration ...
Still I think the Garbage Collector is not destroying all the objects...!!



Or has enough time to run before it fills up.

Mark
 
Sandeep Kumar S Jakkaraju
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it runs about 2 hours then it fills up
 
Faraz Masood
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you trying calling System.gc() repeatedly ..

hopefully sometime it may force the lazy gc to get up and do some useful work for us ..
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try sleeping for 200 milliseconds every few hundred times through the loop. This should give GC enough time to run. You may adjust that interval up or down depending on how fast GC runs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic