2 Replies - 1391 Views - Last Post: 19 May 2003 - 07:37 AM Rate Topic: -----

#1 Noffke  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 497
  • Joined: 09-August 02

Deleting

Posted 19 November 2002 - 01:24 PM

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

Is This A Good Question/Topic? 0
  • +

Replies To: Deleting

#2 pergesu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 13-October 02

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.
Was This Post Helpful? 0
  • +
  • -

#3 Noffke  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 497
  • Joined: 09-August 02

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1