Function level try recourse directives.
Mark Raynsford
org.openjdk at io7m.com
Tue Dec 27 18:53:17 UTC 2022
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 --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20221227/42d2018f/attachment.sig>
More information about the amber-dev
mailing list