johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Kay (Jira)" <>
Subject [jira] [Commented] (JOHNZON-161) JohnzonCDIExtension might create a mem leak
Date Wed, 22 Apr 2020 10:21:00 GMT


Stephen Kay commented on JOHNZON-161:

with v1.1.13:

a) JsonbConfig().setProperty("johnzon.skip-cdi","true") creates a new SimpleJohnzonAdapterFactory()
instead of CdiJohnzonAdapterFactory.

But this has no effect : JohnzonCdiExtension keeps tracking  - and we still must invoke
close() on JsonB in order to kick out inner table JsonbBuilder instances;

b) With *JsonbConfig().setProperty("johnzon.cdi.activated",Boolean.FALSE)* its OKAY (Boolean
and not String).

JohnzonCdiExtension isn't notifed... JsonB instances are closed automatically,


This is the perfect fix we needed - and we'ill see for our next release a better solution
for  performance issues

> JohnzonCDIExtension might create a mem leak
> -------------------------------------------
>                 Key: JOHNZON-161
>                 URL:
>             Project: Johnzon
>          Issue Type: Task
>          Components: JSON-B
>    Affects Versions: 1.1.7
>            Reporter: Mark Struberg
>            Priority: Major
>             Fix For: 1.2.5
> We use Json-B quite heavily and I experienced that there are tons of elements in org.apache.johnzon.jsonb.cdi.JohnzonCdiExtension#jsonbs.
> Way too much for my gut feeling.
> The reason is that we do not use JsonBuilder as autocloseable is that it is not required
by the spec.
> There is also not much documentation for JohnzonCdiExtension, so I can only guess that
it is for cleanly shutting down unused JsonbBuilder instances when the app stops.
> We should probably only store WeakReferences.
> I think the safest

This message was sent by Atlassian Jira

View raw message