• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Memory problem in sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.acceptEntry or below?

 
olze oli
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

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 :/

Any hints in that?

http://docs.oracle.com/javase/7/docs/api/java/nio/file/DirectoryStream.html
I use the same code base...
 
Ank Sri
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
olze oli
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Sorry ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic