lets say you had a very memory intensive program written in Java and your program was running extremely slow because the program ate up all the memory. And you didnt need that data down the line, but Java had not deleted it yet. Is their a way, or does anyone know a way of controlling/overriding the garbage collection that Java uses?
Noffke
Deleting
Page 1 of 12 Replies - 1330 Views - Last Post: 19 May 2003 - 07:37 AM
Replies To: Deleting
#2
Re: Deleting
Posted 17 May 2003 - 01:30 AM
Using System.gc() will cause the garbage collector to run, freeing all memory used by any objects that have been finalized for collection. I've seen a few ways of using this, one involving just calling it periodically, setting a timer to call it every few minutes. The other way I've seen it, and what I prefer more, is having a little bar in the status bar which shows how much memory is being used by the program, and a small button (in this program's case, a trashcan) which you press, which runs the garbage collector.
#3
Re: Deleting
Posted 19 May 2003 - 07:37 AM
Thanks! That's one of the things I don't like about Java, is that sometimes they took away too much complexity from the developer.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|