Dinesh966 / jnativehook

Automatically exported from code.google.com/p/jnativehook
0 stars 0 forks source link

memory leak #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. java -jar JNativeHook.jar 
2. generate mouse and keyboard events
3. make heap dump with java visualvm and it seems that all the generated events 
are kept in the memory

What is the expected output? What do you see instead?
When I press the perform gc button in visualvm and make a heap dump I expect 
that the number of the generated instance of events are reduced.

What version of the product are you using? On what operating system?
version 1.1.2

Please provide any additional information below.
No matter if I turn off all the events (checkboxes) in the demo app.

Original issue reported on code.google.com by bitlea...@gmail.com on 27 Dec 2012 at 11:34

GoogleCodeExporter commented 8 years ago
Using it on Windows 7 with java 7u10 x32.

Original comment by bitlea...@gmail.com on 27 Dec 2012 at 11:38

GoogleCodeExporter commented 8 years ago
Nice catch.  The VM was not automatically freeing the local references for 
mouse events created in the native code as the documentation states it should.  
I explicitly freed the local references in the native code after dispatching 
and everything appears to be functioning normally now.  I will commit the fix 
after I finish making some unrelated changes.

Original comment by a...@1stleg.com on 28 Dec 2012 at 12:49

GoogleCodeExporter commented 8 years ago
Please Test.

Original comment by a...@1stleg.com on 30 Dec 2012 at 7:27

Attachments:

GoogleCodeExporter commented 8 years ago
Hello,

I've tested the attached lib and it seems it works perfectly now. I've tested 
your demo app and my app that uses your lib. Leaking the memory issue are 
disappeared from both of the apps. Great job! Thanks and keep up your 
outstanding work!

Best regards

Original comment by bitlea...@gmail.com on 31 Dec 2012 at 12:38

GoogleCodeExporter commented 8 years ago

Original comment by a...@1stleg.com on 31 Dec 2012 at 4:35