RFR(S): 8223444: Improve CodeHeap Free Space Management

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue May 14 18:53:59 UTC 2019


Good.

Do we need to be concern about atomicity of marking? We know that memset() is not atomic (may be I am wrong here).
An other thing is I did not get logic in deallocate_tail(). split_block() marks only second half of split segments as 
used and (after call) store bad values in it. What about first part? May be add comment.

Thanks,
Vladimir

On 5/14/19 3:47 AM, Schmidt, Lutz wrote:
> Dear all,
> 
> May I please request reviews for my change?
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8223444
> Webrev: https://cr.openjdk.java.net/~lucy/webrevs/8223444.00/
> 
> What this change is all about:
> ------------------------------
> While working on another topic, I came across the code in share/memory/heap.cpp. I applied some small changes which I would call improvements.
> 
> Furthermore, and in particular with these changes, the platform-specific parameter CodeCacheMinBlockLength should by fine-tuned to minimize the number of residual small free blocks. Heap block allocation does not create free blocks smaller than CodeCacheMinBlockLength. This parameter value should match the minimal requested heap block size. If it is too small, such free blocks will never be re-allocated. The only chance for them to vanish is when a block next to them gets freed. Otherwise, they linger around (mostly at the beginning of) the free list, slowing down the free block search.
> 
> The following free block counts have been found after running JVM98 with different CodeCacheMinBlockLength values. I have used -XX:+PrintCodeHeapAnalytics to see the CodeHeap state at VM shutdown.
> 
> JDK-8223444 not applied
> =======================
> 
>          Segment  |  free blocks with CodeCacheMinBlockLength=
>            Size   |       1      2      3      4      6      8
> -----------------+-------------------------------------------
> aarch      128   |       0    153     75     30     38      2
> ppc        128   |       0    149     98     59     14      2
> ppcle      128   |       0    219    161    110     69     34
> s390       256   |       0    142     93     59     30     10
> x86        128   |       0    215    157    118     42     11
> 
> 
> JDK-8223444 applied
> ===================
> 
>          Segment  |  free blocks with CodeCacheMinBlockLength=  |  suggested
>            Size   |       1      2      3      4      6      8  |   setting
> -----------------+---------------------------------------------+------------
> aarch      128   |     221    115     80     36      7      1  |     6
> ppc        128   |     245    152    101     54     14      4  |     6
> ppcle      128   |     243    144     89     72     20      5  |     6
> s390       256   |     168     60     67      8      6      2  |     4
> x86        128   |     223    139     83     50     11      2  |     6
> 
> Thank you for your time and opinion!
> Lutz
> 
> 
>   
> 


More information about the hotspot-compiler-dev mailing list