Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-07 Thread Chris Plummer
On Thu, 30 Nov 2023 00:26:25 GMT, Alex Menkov wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) shou

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-06 Thread Alex Menkov
On Tue, 5 Dec 2023 01:41:33 GMT, Chris Plummer wrote: > I was actually referring to the footprint of the hprof file, not the in > process memory usage while producing it. > > My concern with not doing the option to exclude stack traces now is that it > could result in some unusable or unmanage

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-05 Thread Alan Bateman
On 04/12/2023 18:59, Chris Plummer wrote: So does this mean if the application is no longer referencing the ExecutorService, then we can have unreachable virtual threads that have not completed? This is really the point I've been getting at. Yes, this is possible. It would be an unusual sce

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-04 Thread Chris Plummer
On Tue, 5 Dec 2023 01:20:28 GMT, Alex Menkov wrote: > VM_HeapDumper caches stack traces for platform/carrier and mounted virtual > threads only. > For unmounted virtual threads ThreadDumper objects are created on the stack > (see `VM_HeapDumper::dump_vthread`), so I don't see problems with memo

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-04 Thread Alex Menkov
On Mon, 4 Dec 2023 19:14:59 GMT, Chris Plummer wrote: > > My understanding that information about references is one of the most > > important things for dump analysis (and that's what the issue about). So we > > cannot avoid stack unwinding for unmounted virtual threads. > > As for heapdump fil

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-04 Thread Chris Plummer
On Sat, 2 Dec 2023 01:48:28 GMT, Alex Menkov wrote: > My understanding that information about references is one of the most > important things for dump analysis (and that's what the issue about). So we > cannot avoid stack unwinding for unmounted virtual threads. > As for heapdump file size, ea

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-04 Thread Chris Plummer
On 12/4/23 5:20 AM, Alan Bateman wrote: On 04/12/2023 12:41, David Holmes wrote: On 1/12/2023 2:08 pm, Alex Menkov wrote: On Thu, 30 Nov 2023 21:11:08 GMT, Chris Plummer wrote: I wasn't thinking in terms of the scheduler somehow no longer references the virtual thread, but instead the pr

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-04 Thread Alan Bateman
On 04/12/2023 12:41, David Holmes wrote: On 1/12/2023 2:08 pm, Alex Menkov wrote: On Thu, 30 Nov 2023 21:11:08 GMT, Chris Plummer wrote: I wasn't thinking in terms of the scheduler somehow no longer references the virtual thread, but instead the program no longer referencing the scheduler

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-04 Thread David Holmes
On 1/12/2023 2:08 pm, Alex Menkov wrote: On Thu, 30 Nov 2023 21:11:08 GMT, Chris Plummer wrote: I wasn't thinking in terms of the scheduler somehow no longer references the virtual thread, but instead the program no longer referencing the scheduler (and also not referencing the virtual threa

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-01 Thread Leonid Mesnik
On Thu, 30 Nov 2023 00:26:25 GMT, Alex Menkov wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) shou

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-12-01 Thread Alex Menkov
On Fri, 1 Dec 2023 05:43:41 GMT, Chris Plummer wrote: > One concern I have is when there is a large number of virtual threads, the > dump may take too long and the hprof file gets bloated. My concern mostly > comes from the large number of virtual thread stack traces that will be > present. Du

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-30 Thread Chris Plummer
On Thu, 30 Nov 2023 00:26:25 GMT, Alex Menkov wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) shou

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-30 Thread Alex Menkov
On Thu, 30 Nov 2023 21:11:08 GMT, Chris Plummer wrote: > I wasn't thinking in terms of the scheduler somehow no longer references the > virtual thread, but instead the program no longer referencing the scheduler > (and also not referencing the virtual thread). AFAIU unfinished unmounted virtua

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-30 Thread Chris Plummer
On Thu, 30 Nov 2023 20:44:33 GMT, Alex Menkov wrote: > I'm not sure I understand the scenario. The state is set to TERMINATED after > the thread completes its execution. > So a virtual thread was scheduled, mounted, did some work (as state != NEW) > and then scheduler unmounts it and decides to

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-30 Thread Alex Menkov
On Thu, 30 Nov 2023 05:29:46 GMT, Chris Plummer wrote: > > There is a check for virtual thread liveness which has to be good enough in > > general: > > ``` > > 1617 static bool should_dump_vthread(oop vt) { > > 1618 return java_lang_VirtualThread::state(vt) != > > java_lang_VirtualThread:

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-30 Thread Serguei Spitsyn
On Thu, 30 Nov 2023 05:29:46 GMT, Chris Plummer wrote: > That should in general take care of most unreachable virtual threads, but > technically I don't think a virtual thread has to reach the TERMINATED state > in order to become unreachable. However, it will never get scheduled. Agreed. ---

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-29 Thread Chris Plummer
On Wed, 29 Nov 2023 22:22:09 GMT, Serguei Spitsyn wrote: > There is a check for virtual thread liveness which has to be good enough in > general: > > ``` > 1617 static bool should_dump_vthread(oop vt) { > 1618 return java_lang_VirtualThread::state(vt) != > java_lang_VirtualThread::NEW >

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-29 Thread Serguei Spitsyn
On Thu, 30 Nov 2023 00:26:25 GMT, Alex Menkov wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) shou

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-29 Thread Alex Menkov
On Wed, 29 Nov 2023 22:16:53 GMT, Serguei Spitsyn wrote: >> I think the easiest solution is probably just coming up with some reasonable >> max sequence number and then just assuming that you will need enough chars >> for it. But if you want to actually compute it, there are a few solutions, >

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-29 Thread Alex Menkov
On Wed, 29 Nov 2023 22:38:18 GMT, Serguei Spitsyn wrote: >> Alex Menkov has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - feedback >> - prepare_parallel_dum > > src/hotspot/share/services/heapDumper.cpp line 1947: > >> 1945: _comp

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-29 Thread Alex Menkov
On Wed, 29 Nov 2023 20:14:07 GMT, Chris Plummer wrote: >> Alex Menkov has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - feedback >> - prepare_parallel_dum > > src/hotspot/share/services/heapDumper.cpp line 1886: > >> 1884: }; >> 1885:

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

2023-11-29 Thread Alex Menkov
> The change impelements dumping of unmounted virtual threads data (stack > traces and stack references). > Unmounted vthreads can be detected only by iterating over the heap, but hprof > stack trace records (HPROF_FRAME/HPROF_TRACE) should be written before > HPROF_HEAP_DUMP/HPROF_HEAP_DUMP_SEG

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-29 Thread Serguei Spitsyn
On Tue, 14 Nov 2023 21:54:06 GMT, Alex Menkov wrote: > The change impelements dumping of unmounted virtual threads data (stack > traces and stack references). > Unmounted vthreads can be detected only by iterating over the heap, but hprof > stack trace records (HPROF_FRAME/HPROF_TRACE) should b

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-29 Thread Serguei Spitsyn
On Tue, 14 Nov 2023 21:54:06 GMT, Alex Menkov wrote: > The change impelements dumping of unmounted virtual threads data (stack > traces and stack references). > Unmounted vthreads can be detected only by iterating over the heap, but hprof > stack trace records (HPROF_FRAME/HPROF_TRACE) should b

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-29 Thread Serguei Spitsyn
On Wed, 29 Nov 2023 20:51:02 GMT, Chris Plummer wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) sh

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-29 Thread Serguei Spitsyn
On Wed, 29 Nov 2023 20:31:50 GMT, Chris Plummer wrote: >> src/hotspot/share/services/heapDumper.cpp line 2026: >> >>> 2024: size_t buf_size = strlen(base_path) >>> 2025: + 2 // ".p" >>> 2026: + 1 + (seq / 10)// number >> >> Is this

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-29 Thread Chris Plummer
On Wed, 29 Nov 2023 20:29:40 GMT, Chris Plummer wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) sh

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-29 Thread Chris Plummer
On Tue, 14 Nov 2023 21:54:06 GMT, Alex Menkov wrote: > The change impelements dumping of unmounted virtual threads data (stack > traces and stack references). > Unmounted vthreads can be detected only by iterating over the heap, but hprof > stack trace records (HPROF_FRAME/HPROF_TRACE) should b

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-16 Thread Alex Menkov
On Thu, 16 Nov 2023 02:30:23 GMT, Yi Yang wrote: >> The change impelements dumping of unmounted virtual threads data (stack >> traces and stack references). >> Unmounted vthreads can be detected only by iterating over the heap, but >> hprof stack trace records (HPROF_FRAME/HPROF_TRACE) should b

Re: RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-15 Thread Yi Yang
On Tue, 14 Nov 2023 21:54:06 GMT, Alex Menkov wrote: > The change impelements dumping of unmounted virtual threads data (stack > traces and stack references). > Unmounted vthreads can be detected only by iterating over the heap, but hprof > stack trace records (HPROF_FRAME/HPROF_TRACE) should b

RFR: 8299426: Heap dump does not contain virtual Thread stack references

2023-11-14 Thread Alex Menkov
The change impelements dumping of unmounted virtual threads data (stack traces and stack references). Unmounted vthreads can be detected only by iterating over the heap, but hprof stack trace records (HPROF_FRAME/HPROF_TRACE) should be written before HPROF_HEAP_DUMP/HPROF_HEAP_DUMP_SEGMENT. Heap