This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Performance and the fly likes Memory problem in sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.acceptEntry or below? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Memory problem in sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.acceptEntry or below?" Watch "Memory problem in sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.acceptEntry or below?" New topic
Author

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

olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
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

Joined: Apr 09, 2007
Posts: 3
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.


---
Ankur Srivastava
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
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 ;)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Memory problem in sun.nio.fs.WindowsDirectoryStream$WindowsDirectoryIterator.acceptEntry or below?
 
Similar Threads
How to read memory usage for process running in Linux,
Regarding contiguous memory region in heap
How to increase Jar heap space in Linux
JAVA HEAP SIZE and files to byte[]-Array
OutOfMemoryException