Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java in General and the fly likes memory management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "memory management" Watch "memory management" New topic

memory management

Shiva Kumar
Ranch Hand

Joined: Feb 09, 2001
Posts: 30
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?
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
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 ...
Art Metzer
Ranch Hand

Joined: Oct 31, 2000
Posts: 241
I can't solve your problem, but I just thought I'd share that 1 lakh = 100,000.
Is object pooling an option here?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
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.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: memory management
It's not a secret anymore!