RFR: 8058176: [mlvm] tests should not allow code cache exhaustion [v2]
Tobias Hartmann
thartmann at openjdk.java.net
Wed Mar 3 12:43:52 UTC 2021
On Mon, 22 Feb 2021 20:33:58 GMT, Evgeny Nikitin <enikitin at openjdk.org> wrote:
>> hm... that can mean that there is a product bug (or my recollections about code heaps aren't as good as I thought).
>>
>> @TobiHartmann , @iwanowww, could you please take a look? Evgeny's observations suggest that method handle intrinsics use `non-profiled nmethods` and `profiled nmethods` heaps and not `non-nmethods` heap despite the fact that the last one has plenty of free space. my understanding is/was that we should have used `non-nmethods` heap for MH intrinsic 1st and if it's exhausted start to use the other heaps.
>>
>> Thanks,
>> -- Igor
>
> I inspected sample built up cache with 'Compiler.CodeHeap_Analytics' diagnostic command. The vast majority of the 'non-profiled nmethods' heap are zillions of `invokeBasic`, `linkToStatic` and similar, with different signatures. Dump shows something like this:
>
> nMethod (active) invokeBasic(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
> nMethod (active) invokeBasic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;DFJD)Ljava/lang/Object;
> nMethod (active) invokeBasic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;DFJDLjava/lang/Object;)Ljava/lang/Object;
> nMethod (active) invokeBasic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;DFJDLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
>
> ... with their signatures marching to the right screen border and beyond. Given that their arguments are mish-mashed in all possible combinations, there are really many of them (I've been able to build up cashes up to 300MB without a pair signatures repeating). They are nmethods, and should be in the nmethods cache, aren't they?
Sorry for missing the @TobiHartmann (I had github notifications disabled).
Unlike VM internal adapters/buffers/runtime stubs, Method handle intrinsics are actual Java methods that are compiled by the JIT and therefore need to go into the profiled or non-profiled code cache segment. They can not go into the non-nmethod segment.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2523
More information about the hotspot-dev
mailing list