Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

memory management

 
Shiva Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi javapros,
my problem is like this.
in my application im creating a vector that holds more than one lakh records. I view all the records being hold by the vector in a GUI.After closing my GUI and once again if try to view those records im getting following memory error as "OutOfMemoryError"
.Though i tried setting that variable to null and calling garbage collector im unable to rectify that error.
can any one help me to solve that problem?
shiva
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is a very open ended question! I am not sure what one lakh records is ... 1000, 10000, 100000?
It might be related to how you are giving the GUI the vector. Duplicating it or just using a reference to it?
What does closing the GUI mean? Just setting visible to false or disposing of it?
What do you mean, "trying to view vector again"?
Some code might help ...
Manfred.
 
Art Metzer
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't solve your problem, but I just thought I'd share that 1 lakh = 100,000.
Is object pooling an option here?
Art
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need to hold ALL of your records in memory at the same time. Sounds like a design problem here. Surely there is a way to narrow down what you want to work on, and selectively load only those records.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic