[jmmc-tech-group] Internal SAMP Hub ?

Laurent Bourgès bourges.laurent at gmail.com
Fri Jan 27 09:08:01 PST 2012


Mark and all samp users,

Here again I submit you a patch for JSamp 1.3.2 that fixes definitely
both shutdown hook issues (client and hub shutdown ordering i.e.
leaking zombie clients) and fixes a lot of memory leaks related to
client register / unregister :
- Shutdown hook Threads were disabling garbage collection for Hub /
XmlHubConnection
- java.util.Timer Threads never stopped: HubConnector.regTimer related
to setAutoConnect(), ClientTracker.tidyTimer
- ResultHandler timeout watcher thread never stopped:
HubConnector.CallHandler.timeouter
- leaking InternalServer instances related to every client started /
stopped and also HttpServer.Handler instances ...

I provide also in the patch my test class which loops over
[setActive(true / false] 10 000 times.
With standard 1.3.2 release and JVM settings set to "-Xms8m -Xmx8m
-XX:+HeapDumpOnOutOfMemoryError -verbose:gc"; I get an
OutOfMemoryError after 200 iterations.
With my patched JSAMP, the test succeeds i.e. 10 000 iterations are OK.

Mark, could you look at the code (modifications indicated by // LAURENT) ?
If you updated JSAMP code, I could contribute to test / update the
patch or help you to understand / fix such problems.

FYI, I am not really sure how to properly clean up
CallableClientServer / InternalServer / HttpServer leaks.

Hope that these problems will one day be fixed in JSAMP release and it
will help all of us enjoy JSAMP;

In particular it could help WebProfile use cases as it requires many
client register / unregister operations ...

Best regards,
Laurent
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture-XmlRpcHubConnection-ShutdownThreadLEAK.png
Type: image/png
Size: 207068 bytes
Desc: not available
URL: <http://www.ivoa.net/pipermail/apps-samp/attachments/20120127/5355ab69/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsamp_1.3.2_patch.tar.gz
Type: application/x-gzip
Size: 41034 bytes
Desc: not available
URL: <http://www.ivoa.net/pipermail/apps-samp/attachments/20120127/5355ab69/attachment-0001.gz>


More information about the apps-samp mailing list