- A Concurrent Affair - https://www.concurrentaffair.org -

Asserting Garbage Collection in Unit Tests

I just read a blog post by Tor Norbye called How to Write a Memory Leak Unit Test [1]. In it, he describes how code from the NetBeans team can be used to find memory leaks. It seems like it’s a more advanced, user-friendly way of doing what I described before [2]. In particular, the chain of references preventing garbage collection is actually printed out during the test.

I definitely have to take a closer look at this. Thanks, Tor!

[3] [4]Share [5]