johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <>
Subject [jira] [Commented] (JOHNZON-161) JohnzonCDIExtension might create a mem leak
Date Thu, 08 Mar 2018 20:56:00 GMT


Romain Manni-Bucau commented on JOHNZON-161:

It is in the javadoc: If you
dont close it you assume no cdi bean has been used by the runtime which is unknown from user
perspective - even if you control your models since jsonb can use cdi beans if desired implicitly

Also technically there is no way it works otherwise. Weak* solution will lead to classnotfound
or missed predestroy which can be a disaster in some apps.

Examples not calling close are either wrong or - as i want to think - shortcuts to show something

> 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.1.8
> 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