kopf.lastig | Alles mögliche zu Themen wie Familie, Beruf, Medien etc. …

Aug/05

5

Using a Garbage Collector doesn’t free you from thinking

about references. Memory leaks are still possible - if an object has a "reachable" reference (whatever that is in your context) it won't be garbage collected. You still have to think about who references your objects and how long.

For instance, in my current project using Java Swing, someone said

JAVA:
  1. getCurrentFocusManager().addKeyEventDispatcher(this)

in a constructor. Then we got reports OutOfMemory-Error. A simple

JAVA:
  1. getCurrentFocusManager().removeKeyEventDispatcher(this);

solved this issue.

It's harder than you think!

Im Web 2.0 mit anderen teilen:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • DZone
  • email
  • FriendFeed
  • MisterWong.DE
  • MySpace
  • PDF
  • Reddit
  • RSS
  • Tumblr
  • Twitter

·

No comments yet.

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me