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

Comments

Projects
None yet
2 participants
@SerCeMan

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

This comment has been minimized.

Show comment
Hide comment
@EtiennePerot

EtiennePerot Jun 6, 2015

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?

Owner

EtiennePerot commented Jun 6, 2015

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

This comment has been minimized.

Show comment
Hide comment
@SerCeMan

SerCeMan 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

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