Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Yi Yang
On Fri, 27 May 2022 06:22:36 GMT, Ioi Lam wrote: > I think the right fix is to just convert the MetaspacePool into > NonClassMetaspacePool and only report the non-class values. Yes, it's okay for me. But I have another concern. The compressed class pool is not directly used by other VM compone

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Ioi Lam
On Fri, 27 May 2022 05:31:24 GMT, David Holmes wrote: > The basic problem is that we have two non-heap pools: > > * `MetaspacePool` > > * consists of `ClassType` and `NonClassType` parts > * `CompressedKlassSpacePool` > > but the `CompressedKlassSpacePool` is actually the "ClassType" part

Re: RFR: 8287362: FieldAccessWatch testcase failed on AIX platform

2022-05-26 Thread David Holmes
On Thu, 26 May 2022 17:26:25 GMT, Ichiroh Takiguchi wrote: > On AIX platform, > `test/hotspot/jtreg/serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java` > testcase failed by single testcase execution. > > Failure message is: > > Error occurred during initialization of VM > agent libr

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread David Holmes
On Mon, 23 May 2022 07:28:41 GMT, Yi Yang wrote: > It seems that calculation of > MemoryMXBean.getNonHeapMemoryUsage(jmm_GetMemoryUsage) is wrong. > > Currently, > `NonHeapUsage=CodeCache+Metaspace(ClassTypeSpace+NonClassTypeSpace)+CompressedClassSpace(ClassTypeSpace)` > > ==> CodeHeap 'non-n

Integrated: 8287200: Test java/lang/management/ThreadMXBean/VirtualThreadDeadlocks.java timed out after JDK-8287103

2022-05-26 Thread Leonid Mesnik
On Tue, 24 May 2022 19:52:57 GMT, Leonid Mesnik wrote: > Need to use proper synchronization. > > The CyclicBarriers might move the thread to WAITING state but not BLOCKED. So > it should not confuse existing checks. This pull request has now been integrated. Changeset: 176bb23d Author:Leo

Re: RFR: 8287200: Test java/lang/management/ThreadMXBean/VirtualThreadDeadlocks.java timed out after JDK-8287103 [v2]

2022-05-26 Thread Alan Bateman
On Thu, 26 May 2022 22:27:15 GMT, Leonid Mesnik wrote: >> Need to use proper synchronization. >> >> The CyclicBarriers might move the thread to WAITING state but not BLOCKED. >> So it should not confuse existing checks. > > Leonid Mesnik has updated the pull request incrementally with one addit

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread David Holmes
On Fri, 27 May 2022 02:12:32 GMT, Yi Yang wrote: >> Yes counting it twice is wrong but this is the wrong fix. The pools are not >> defined correctly. > >> Sorry for chiming in in a not very helpful way, but I am not sure what even >> the point is of this API. >> >> I'm seriously interested in

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Yi Yang
On Thu, 26 May 2022 22:17:17 GMT, David Holmes wrote: >> Beside my general points, I think this patch makes sense. I agree with >> @kelthuzadx that counting Classspace twice is wrong, whatever the intention >> of this API originally was. > > Yes counting it twice is wrong but this is the wrong

Re: RFR: 8287200: Test java/lang/management/ThreadMXBean/VirtualThreadDeadlocks.java timed out after JDK-8287103 [v2]

2022-05-26 Thread Leonid Mesnik
> Need to use proper synchronization. > > The CyclicBarriers might move the thread to WAITING state but not BLOCKED. So > it should not confuse existing checks. Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision: fix - Ch

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread David Holmes
On Thu, 26 May 2022 13:47:55 GMT, Thomas Stuefe wrote: >> In any case, it's unreasonable for getNonHeapMemoryUsage to count a piece of >> memory repeatedly, right? In the extreme case, we might add all nested pools >> of metaspace, and we will get Metaspace x2 + CodeCache when using >> getNonH

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Mandy Chung
On Mon, 23 May 2022 07:28:41 GMT, Yi Yang wrote: > It seems that calculation of > MemoryMXBean.getNonHeapMemoryUsage(jmm_GetMemoryUsage) is wrong. > > Currently, > `NonHeapUsage=CodeCache+Metaspace(ClassTypeSpace+NonClassTypeSpace)+CompressedClassSpace(ClassTypeSpace)` > > ==> CodeHeap 'non-n

RFR: 8287362: FieldAccessWatch testcase failed on AIX platform

2022-05-26 Thread Ichiroh Takiguchi
On AIX platform, `test/hotspot/jtreg/serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java` testcase failed by single testcase execution. Failure message is: Error occurred during initialization of VM agent library failed to init: FieldAccessWatch Failed to set capabilities, error: 98 It

Re: RFR: 8286983: rename jdb -trackvthreads and debug agent enumeratevthreads options and clarify "Preview Feature" nature of these options [v4]

2022-05-26 Thread Chris Plummer
> As part of the loom integration, jdb added `-trackvthreads` and the debug > agent added `enumeratevthreads`. These options are being renamed to > `-trackallthreads` and `includevirtualthreads` (the shorthand `vthreads` > should not have been used). Also, the help text for these options now cal

Re: RFR: 8286983: rename jdb -trackvthreads and debug agent enumeratevthreads options and clarify "Preview Feature" nature of these options [v3]

2022-05-26 Thread Chris Plummer
On Thu, 26 May 2022 03:47:35 GMT, Chris Plummer wrote: >> Again I have to say I agree with Chris. The flag itself is a "preview" flag >> and relates to a "preview feature". If the feature goes obviously the flag >> does too, but the flag could go even if the feature stays. > > Please see the di

Re: RFR: 8286983: rename jdb -trackvthreads and debug agent enumeratevthreads options and clarify "Preview Feature" nature of these options [v3]

2022-05-26 Thread Chris Plummer
> As part of the loom integration, jdb added `-trackvthreads` and the debug > agent added `enumeratevthreads`. These options are being renamed to > `-trackallthreads` and `includevirtualthreads` (the shorthand `vthreads` > should not have been used). Also, the help text for these options now cal

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Thomas Stuefe
On Thu, 26 May 2022 11:32:46 GMT, Yi Yang wrote: >> I think the problem is the definition of the pools. We seem to have nested >> pools but it is far from clear that this API/mechanism was designed/intended >> to support nested pools. > > In any case, it's unreasonable for getNonHeapMemoryUsage

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Thomas Stuefe
On Thu, 26 May 2022 12:47:42 GMT, David Holmes wrote: >> In any case, it's unreasonable for getNonHeapMemoryUsage to count a piece of >> memory repeatedly, right? In the extreme case, we might add all nested pools >> of metaspace, and we will get Metaspace x2 + CodeCache when using >> getNonHe

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread David Holmes
On Thu, 26 May 2022 11:32:46 GMT, Yi Yang wrote: >> I think the problem is the definition of the pools. We seem to have nested >> pools but it is far from clear that this API/mechanism was designed/intended >> to support nested pools. > > In any case, it's unreasonable for getNonHeapMemoryUsage

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread Yi Yang
On Thu, 26 May 2022 07:34:59 GMT, David Holmes wrote: >> This is also acceptable, but if we add more memory pools, we might add more >> special pools to exclude their space from nonheap. Instead, we can specify >> exactly which pools we need to accumulate, which is what this change did. > > I t

Re: RFR: 8286960: Test serviceability/jvmti/vthread/SuspendResume2 crashed: missing ThreadsListHandle in calling context

2022-05-26 Thread David Holmes
On Wed, 25 May 2022 07:23:36 GMT, Serguei Spitsyn wrote: > A part of this issue was contributed with the following changeset: > > commit ea23e7333e03abb4aca3e9f3854bab418a4b70e2 > Author: Daniel D. Daugherty <[dcu...@openjdk.org](mailto:dcu...@openjdk.org)> > Date: Mon Nov 8 14:45:04 2021 +

Re: RFR: 8287135: Calculation of jmm_GetMemoryUsage is wrong

2022-05-26 Thread David Holmes
On Thu, 26 May 2022 05:59:30 GMT, Yi Yang wrote: >> src/hotspot/share/services/management.cpp line 753: >> >>> 751: for (int i = 0; i < MemoryService::num_memory_pools(); i++) { >>> 752: MemoryPool* pool = MemoryService::get_memory_pool(i); >>> 753: if (pool->is_codeheap() || poo

Re: RFR: 8286960: Test serviceability/jvmti/vthread/SuspendResume2 crashed: missing ThreadsListHandle in calling context

2022-05-26 Thread Serguei Spitsyn
On Wed, 25 May 2022 07:23:36 GMT, Serguei Spitsyn wrote: > A part of this issue was contributed with the following changeset: > > commit ea23e7333e03abb4aca3e9f3854bab418a4b70e2 > Author: Daniel D. Daugherty <[dcu...@openjdk.org](mailto:dcu...@openjdk.org)> > Date: Mon Nov 8 14:45:04 2021 +