johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (Jira)" <j...@apache.org>
Subject [jira] [Commented] (JOHNZON-161) JohnzonCDIExtension might create a mem leak
Date Wed, 22 Apr 2020 05:29:00 GMT

    [ https://issues.apache.org/jira/browse/JOHNZON-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17089295#comment-17089295
] 

Romain Manni-Bucau commented on JOHNZON-161:
--------------------------------------------

Hi [~skay], first of all it is a bug in your application so best is to fix your coding style.
Now you have a workaround: set johnzon.skip-cdi=true or johnzon.cdi.activated=false in the
jsonbconfig properties or set property johnzon.factory to new SimpleJohnzonAdapterFactory().

 

Side note: in terms of performance, recreating Jsonb instances looses all caching and redo
all the reflection so should be slow so in any case I recommend you to change the pattern
you have (it is true for jackson too btw)

> JohnzonCDIExtension might create a mem leak
> -------------------------------------------
>
>                 Key: JOHNZON-161
>                 URL: https://issues.apache.org/jira/browse/JOHNZON-161
>             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
(v8.3.4#803005)

Mime
View raw message