Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to increase performance (big thread allocation) #53

Open
SerCeMan opened this issue Jun 3, 2015 · 2 comments
Open

Way to increase performance (big thread allocation) #53

SerCeMan opened this issue Jun 3, 2015 · 2 comments

Comments

@SerCeMan
Copy link

SerCeMan commented Jun 3, 2015

Native.detach(false) in some callbacks help me to significantly increase performance.

The problem is every call from native code JNA allocates java Thread class and init it. So in case of extensive usage i get 1TB allocated young garbage per minute.

Native.detach(false) helps me to solve problem.

@EtiennePerot
Copy link
Owner

This is interesting, though it's not really clear if the fuse-jna library should be doing this by default, or what mechanism it should have so that the user filesystem can express which callbacks should be detach(false)'d or not, and when.

Do you have benchmarks on the performance difference, on one of the example filesystems for example?

@SerCeMan
Copy link
Author

SerCeMan commented Jun 6, 2015

No i tested in with my own filesystem, but you can easily reproduce you with memoryFs, FS benchmark (fio for example) and memory allocation profiler (Java mission control for example ).

Maybe it also possible fix it with properly thread initialization with Native.setCallbackThreadInitializer, but detach(false) is easiest solution.

Also, it might be interested for you to look at some related issues https://groups.google.com/forum/#!topic/gstreamer-java/DCDCPjf7uME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants