Function level try recourse directives.

Nathan Reynolds numeralnathan at gmail.com
Wed Dec 28 20:15:03 UTC 2022


CloseableCollection is a class of the library.  It won't show up in heap
dumps because probably very few people are using it.  You would need to
look at JIT optimized assembly to see if JIT is eliding the
CloseableCollection and it's internal data structure (array?).

On Tue, Dec 27, 2022 at 10:53 AM Mark Raynsford <org.openjdk at io7m.com>
wrote:

> On 2022-12-27T09:42:53 -0800
> Nathan Reynolds <numeralnathan at gmail.com> wrote:
>
> > If the CloseableCollection doesn't escape (likely), then JIT will get rid
> > of the object allocation.  The internal Closeable[] (?) may still stick
> > around... unless JIT can determine it doesn't escape too.  Can JIT escape
> > analysis get rid of small arrays?  If so, the CloseableCollection's
> > footprint disappears.  The only thing remaining is the logic.  That's
> > exactly what an enhanced try-with-resources would do.
>
> I haven't been able to spot any instances of the closeable collection
> in heap samples, or the internal ArrayDeque instances. Doing
> soft-realtime work, you can be certain I'm looking at heap samples. :)
>
> It hasn't even been necessary so far to use anything other than the
> default array size. Those instances are either gone in a single method,
> or they live for a very long time (and we're talking about less than a
> couple of hundred bytes per collection, typically).
>
> --
> Mark Raynsford | https://www.io7m.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20221228/25ce4dfc/attachment.htm>


More information about the amber-dev mailing list