Hi everybody,
I found a memory leak caused by a misuse of the DefaultHapiContext.
To keep it short, we were creating many different DefaultHapiContext using
the default constructor:
HapiContext ctx = new DefaultHapiContext();

This caused a memory leak! The instances of DefaultHapiContext are not
collected by the garbage collector since they are referenced by the
ApplicationShutdownHook!

I found that when calling new DefaultHapiContext(), HAPI creates a default
ExecutorService which is then registered to the shutdown hook. This happens
when the getExecutorService() is called.

I don't know if this needs to get fixed (in the code or in the javadoc),
but at least I wanted to share with you this problem.

We solved the problem passing a custom ExecutorService to the
DefaultHapiContext constructor.
------------------------------------------------------------------------------
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to