GCViewer icon indicating copy to clipboard operation
GCViewer copied to clipboard

Wrong graph display when open series

Open NoiseLab23 opened this issue 2 years ago • 4 comments

Hello, My GC logs are configured with a rotation based on the size. When I restart the JVM it creates a new one and keep the old ones. If I open my gc logs as a series, the display of the graph is totally crazy. It looks like the parsing of the different files has a problem and don't understand there has been a break beetween the logs. Thank you for your feedback. gcviewer_crazy_graph gc_logs.zip

NoiseLab23 avatar Jun 07 '23 09:06 NoiseLab23

I think I found the reason. The GC(*) index is reset to 0 when the JVM restart image and the time from start too...

NoiseLab23 avatar Jun 07 '23 11:06 NoiseLab23

Hi

I don't think it has to do with the GC(*) index. It is used during parsing to keep lines together that are part of the same gc event. But they are not used for rendering.

I suspect it is related to the order of the files during parsing. If a file with later timestamps is parsed first and one with earlier timestamps later, then the graph is corrupt, because the events are not ordered by timestamp. I don't remember the ordering criteria during parsing any more, but I remember some discussion around the subject.

A solution would probably need to order the files by timestamp (maybe filetimestamp would be enough) or make the internal list of events ordered by timestamp. The latter is not always possible, because the logs may not contain timestamps, but simply durations since startup. So it would probably have to involve (better?) ordering of the files during parsing.

I see, that GcSeriesLoader#determineStartTimePerGcModel() tries to do some ordering. Maybe that logic is broken.

Best regards Jörg

chewiebug avatar Jun 07 '23 17:06 chewiebug

I made some tests on my side and I'm pretty sure the durations since startup is used to determined the timeline

NoiseLab23 avatar Jun 08 '23 07:06 NoiseLab23

Good hint! That would definitively explain the current graph display!

chewiebug avatar Jun 08 '23 16:06 chewiebug