RFR (xs): 8134992: vm/gc/compact/Compact_InternedStrings_Strings failed due to a malloc() failure

Mikael Gerdin mikael.gerdin at oracle.com
Tue Feb 23 09:15:57 UTC 2016


Hi Derek,


On 2016-02-22 19:39, Derek White wrote:
> Very simple fix for a bug on Solaris and small performance issue 
> everywhere else.
>
> *Bug*: JDK-8134992 <https://bugs.openjdk.java.net/browse/JDK-8134992> 
> vm/gc/compact/Compact_InternedStrings_Strings failed due to a malloc() 
> failure
> *Webrev*: http://cr.openjdk.java.net/~drwhite/8134992/webrev.01

Good catch!

The change looks good to me.

/Mikael

> *Tests*: jprt, partial Aurora perf.
>
> *Background*:
> Many of the vm.gc.compact tests create large strings and/or char 
> arrays that don't get allocated in the young gen. 
> RuntimeStub::_new_array_Java() and 
> RuntimeStub::_new_array_nozero_Java() have to call 
> CollectedHeap::new_store_pre_barrier() when deferred store barriers 
> are turned on. Unless the object is in the young gen, 
> new_store_pre_barrier() marks every card for the entire new object as 
> dirty. If the object is very large, this can result in so many 
> enqueued dirty cards that it runs out of memory (due to the malloc 
> constraints in Solaris).
>
> But primitive arrays don't have any references that need need a store 
> barrier, so the whole issue can be avoided in this case. Doing so 
> reduces gc's malloc space usage by up to 30% in these compact tests.
>
> Note that these tests are essentially String.intern micro-benchmarks, 
> so I haven't seen a performance improvement in more general code.
>
> Thanks!
>  - Derek White
>
>
> 	
> 	*clean:* 	*8134992* 	
> 	
> *KB* 	*
> * 	*reserved* 	*reserved* 	*diff* 	*%*
> Humongous_InternedStrings 	malloc 	63743 	48669 	-15,074 	24%
> Compact_InternedStrings1 	malloc 	41738 	39328 	-2,410 	6%
> Compact_Arrays 	malloc 	50943 	50940 	-3 	0%
> Humongous_Strings 	malloc 	66503 	50989 	-15,514 	23%
> *Compact_Strings* 	malloc 	*62757* 	50941 	-11,816 	19%
> /Compact_Strings_InternedStrings/ 	malloc 	68024 	50944 	-17,080 	25%
> Humongous_NonbranchyTree5M 	malloc 	51020 	51038 	18 	
> Compact_InternedStrings 	malloc 	62828 	50938 	-11,890 	19%
> Compact_NonbranchyTree 	malloc 	51024 	51016 	-8 	0%
> Compact_Arrays1 	malloc 	50673 	50682 	9 	0%
> Humongous_Arrays 	malloc 	50949 	50943 	-6 	0%
> Compact_NonbranchyTree1 	malloc 	50704 	50718 	14 	0%
> Compact_NonbranchyTree_TwoFields 	malloc 	51042 	51015 	-27 	0%
> Compact_Strings1 	malloc 	52072 	50681 	-1,391 	3%
> Compact_Arrays_ArrayOf1 	malloc 	50692 	50689 	-3 	0%
> Humongous_Strings1 	malloc 	52003 	50709 	-1,294 	2%
> Compact_Strings_ArrayOf1 	malloc 	52081 	47632 	-4,449 	9%
> Compact_InternedStrings_NonbranchyTree 	malloc 	64031 	50980 
> -13,051 	20%
> Humongous_InternedStrings1 	malloc 	43035 	40631 	-2,404 	6%
> Compact_TwoFields_InternedStrings 	malloc 	50953 	50938 	-15 	0%
> Compact_NonbranchyTree_TwoFields1 	malloc 	50708 	50699 	-9 	0%
> Compact_NonbranchyTree_ArrayOf 	malloc 	51013 	51008 	-5 	0%
> Humongous_Arrays5M 	malloc 	50949 	50955 	6 	0%
> Compact_Arrays_TwoFields 	malloc 	50941 	50955 	14 	0%
> Compact_Arrays_ArrayOf 	malloc 	50945 	50949 	4 	0%
> Humongous_NonbranchyTree1 	malloc 	50709 	50738 	29 	0%
> Compact_Arrays_TwoFields1 	malloc 	50694 	50710 	16 	0%
> Humongous_NonbranchyTree 	malloc 	51018 	51041 	23 	0%
> Compact_NonbranchyTree_ArrayOf1 	malloc 	50728 	50711 	-17 	0%
> Humongous_Arrays1 	malloc 	50694 	50699 	5 	0%
> Compact_InternedStrings_Strings 	malloc 	63836 	50865 	-12,971 	20%
> Compact_Strings_TwoFields 	malloc 	72703 	50932 	-21,771 	30%
> Compact_Strings_ArrayOf 	malloc 	66452 	50932 	-15,520 	23%
> *AVG DIFF (KB)* 	
> 	
> 	
> 	*-4,442* 	*7.15%*
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20160223/d12bb64b/attachment.html>


More information about the hotspot-gc-dev mailing list