Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-13 Thread Jiangli Zhou
Hi Claes, Looks good! Thanks, Jiangli On 8/13/18 7:16 AM, Claes Redestad wrote: Hi Jiangli, On 2018-08-10 19:15, Jiangli Zhou wrote: Hi Claes, The updated Integer.java looks good. The test also looks good to me. I'd suggest adding some checks in CheckIntegerCacheApp test for the cached

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-13 Thread Claes Redestad
Hi Jiangli, On 2018-08-10 19:15, Jiangli Zhou wrote: Hi Claes, The updated Integer.java looks good. The test also looks good to me. I'd suggest adding some checks in CheckIntegerCacheApp test for the cached Integers using WhiteBox API, WhiteBox.isShared(object) to make sure that they are arc

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-10 Thread Jiangli Zhou
Hi Claes, The updated Integer.java looks good. The test also looks good to me. I'd suggest adding some checks in CheckIntegerCacheApp test for the cached Integers using WhiteBox API, WhiteBox.isShared(object) to make sure that they are archived. Checking all cached Integers is probably too ex

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-10 Thread Ioi Lam
On 8/10/18 8:44 AM, Claes Redestad wrote: On 2018-08-10 16:10, Ioi Lam wrote: I've verified all cases I can think of manually, but would like to defer the creation of a sanity test to a follow-up RFE to allow time to think through and discussing how to best go about that (do we need to veri

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-10 Thread Claes Redestad
On 2018-08-10 16:10, Ioi Lam wrote: I've verified all cases I can think of manually, but would like to defer the creation of a sanity test to a follow-up RFE to allow time to think through and discussing how to best go about that (do we need to verify in depth, can we reuse some existing test

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-10 Thread mandy chung
On 8/10/18 6:32 AM, Claes Redestad wrote: On 2018-08-09 18:28, Claes Redestad wrote: On 2018-08-09 17:41, Peter Levart wrote: There's danger when you overwrite a non-null @Stable field with another value that this new value will not be seen. Or is code an exception where @Stable is no

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-10 Thread Ioi Lam
> On Aug 10, 2018, at 6:32 AM, Claes Redestad wrote: > > >> On 2018-08-09 18:28, Claes Redestad wrote: >> >> >>> On 2018-08-09 17:41, Peter Levart wrote: >>> >>> There's danger when you overwrite a non-null @Stable field with another >>> value that this new value will not be seen. Or is

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-10 Thread Claes Redestad
On 2018-08-09 18:28, Claes Redestad wrote: On 2018-08-09 17:41, Peter Levart wrote: There's danger when you overwrite a non-null @Stable field with another value that this new value will not be seen. Or is code an exception where @Stable is not honored yet... Typically IntegerCache:: r

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Claes Redestad
On 2018-08-09 18:38, Peter Levart wrote: On 08/09/2018 06:28 PM, Claes Redestad wrote: On 2018-08-09 17:41, Peter Levart wrote: There's danger when you overwrite a non-null @Stable field with another value that this new value will not be seen. Or is code an exception where @Stable is

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Peter Levart
On 08/09/2018 06:28 PM, Claes Redestad wrote: On 2018-08-09 17:41, Peter Levart wrote: There's danger when you overwrite a non-null @Stable field with another value that this new value will not be seen. Or is code an exception where @Stable is not honored yet... Typically IntegerCache

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Claes Redestad
On 2018-08-09 17:41, Peter Levart wrote: There's danger when you overwrite a non-null @Stable field with another value that this new value will not be seen. Or is code an exception where @Stable is not honored yet... Typically IntegerCache:: runs before JIT has even started, so I think

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Claes Redestad
Hi Peter, On 2018-08-09 17:32, Peter Levart wrote: Hi Claes, When is this archived cache created? The cache you build when dumping the archive is serialized, so java -Xshare:dump -XX:AutoBoxCacheMax=2 would create an array with 20k elements in the archive... Is it possible to create

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Jiangli Zhou
Hi Claes, The change on the VM side looks good! Hope to see more graphs like this in the initial java heap being discovered and archived. Thanks! Jiangli On 8/9/18 4:33 AM, Claes Redestad wrote: Hi, using the new ability to archive immutable heap graphs into the CDS archive, even archivi

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Peter Levart
On 08/09/2018 05:32 PM, Peter Levart wrote: Hi Claes, When is this archived cache created? Is it possible to create archived cache with java.lang.Integer.IntegerCache.high system property set to > 127 ? Wouldn't then at runtime, when cache is initialized from such oversized archive and no

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Peter Levart
Hi Claes, When is this archived cache created? Is it possible to create archived cache with java.lang.Integer.IntegerCache.high system property set to > 127 ? Wouldn't then at runtime, when cache is initialized from such oversized archive and no java.lang.Integer.IntegerCache.high system prop

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Claes Redestad
On 2018-08-09 13:41, Alan Bateman wrote: Nice! Thanks! What would you think about testing a test to at least exercise combinations of AutoBoxCacheMax at dump time and run time. I'll try adding something to the suite of CDS tests.. /Claes

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Claes Redestad
On 2018-08-09 13:42, Stephen Colebourne wrote: On 9 August 2018 at 12:33, Claes Redestad wrote: using the new ability to archive immutable heap graphs into the CDS archive, even archiving small things like the Integer.IntegerCache can be profitable. Interesting. I did consider caching some

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Stephen Colebourne
On 9 August 2018 at 12:33, Claes Redestad wrote: > using the new ability to archive immutable heap graphs into the CDS archive, > even archiving small things like the Integer.IntegerCache can be profitable. Interesting. I did consider caching some instances of `LocalDate` when I was developing JS

Re: RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Alan Bateman
On 09/08/2018 12:33, Claes Redestad wrote: Hi, using the new ability to archive immutable heap graphs into the CDS archive, even archiving small things like the Integer.IntegerCache can be profitable. Webrev: http://cr.openjdk.java.net/~redestad/8209120/open.00/ Bug: https://bugs.openjdk.ja

RFR: 8209120: Archive the Integer.IntegerCache

2018-08-09 Thread Claes Redestad
Hi, using the new ability to archive immutable heap graphs into the CDS archive, even archiving small things like the Integer.IntegerCache can be profitable. Webrev: http://cr.openjdk.java.net/~redestad/8209120/open.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8209120 For a default cac