This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a recursive function which monitors a directory.
If it found a file, it checks if this file matches a given criteria (suffix ends with .ABC for example).
If it matches, the listeners are informed about that file.
As of JDK7, i did not want to use listFiles() which is synchron, i wanted to use an asynchron way to directly start processing.
Thats why i used the brand new feature of streams.
When i profile this application now, i can see that heap space and heap space used (i use netbeans profiler) are fine. CPU usage is also about 0%. But whats really strange is that "Surviving Generations" is rising frequently. Its a pretty decent rising, but i am sure it will crash, sooner or later :/
Olze, just wanted to check if you are closing the directory stream in the finally block. Also if that is there then you can take a heap dump and analyze it to see if there are any memory leaks in the application.
Joined: Jun 20, 2009
First, thanks for your reply ;)
Its a shame - next time i will study the topic deeper.
I have a ThreadPool in my application which never gets garbage collected - as its my ThreadPool.
And thats what survived the whole time. And thats what netbeans told me in the metric. But i thought thats something "evil", thats also the reason what wondered my because the heap space is really fine (and CPU usage).
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Memory problem in sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.acceptEntry or below?