"Protocol message was too large" exception

Questions about YourKit Java Profiler
Locked
llalexandru
Posts: 3
Joined: Wed Aug 21, 2024 8:25 am

"Protocol message was too large" exception

Post by llalexandru »

Hi,

I started using YourKit 2024.03. I am using it to do performance testing for a Java server application.

The server (with 32GB set) is started with the agent:

Code: Select all

-agentpath:~/YourKit-JavaProfiler-2024.3/bin/linux-x86-64/libyjpagent.so
on a bare metal machine (Ubuntu 24.04).
On another machine (also running Ubuntu 24.04 with, 128GB), I am running the YourKit 2024.3 profiler and I connect to the sever via SSH. The telemetry shows the CPU in real-time, so things are going OK. The only change done to the YourKit application is the Xmx from the profiler.sh (to 100GB) and the Xmx from the .yjp/ui.ini (to 100GB).

I am running a time consuming request on the server once to do a cold run (i.e. let the class loader do its job, e.g.). After, I am activating the tracer with:

Code: Select all

time=cpu
adaptive=false
adaptive_min_method_invocation_count=20000
adaptive_max_average_method_time_ns=1000
adaptive_min_method_time_percent=0.1
I am running the request again and I can see the methods being traced in the Method list view from the YourKit UI. So at this point, things are still OK. The server reaches ~20GB and YourKit reached ~75GB.

I attempt to capture a performance snapshot and the dialog that states that the snapshot was captured properly is shown. The snapshot has ~7.5GB. When I am attempting to open it from YourKit (same machine from which the profiling was done), I get "is not a valid snapshot file" and "I/O exception" with a message related to CodedInputStream.setSizeLimit. I went into the logs and found:

Code: Select all

Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message was too large.  May be malicious.  Use CodedInputStream.setSizeLimit() to increase the size limit.
       at com.google.protobuf.InvalidProtocolBufferException.sizeLimitExceeded(InvalidProtocolBufferException.java:139)
       at com.google.protobuf.CodedInputStream$StreamDecoder.refillBuffer(CodedInputStream.java:2746)
       at com.google.protobuf.CodedInputStream$StreamDecoder.readRawByte(CodedInputStream.java:2824)
       at com.google.protobuf.CodedInputStream$StreamDecoder.readRawVarint64SlowPath(CodedInputStream.java:2613)
       at com.google.protobuf.CodedInputStream$StreamDecoder.readRawVarint64(CodedInputStream.java:2606)
       at com.google.protobuf.CodedInputStream$StreamDecoder.readInt64(CodedInputStream.java:2243)
       at com.yourkit.protocol.generated.CpuProfilingRecordProto$Builder.mergeFrom(a:388)
       at com.yourkit.protocol.generated.CpuProfilingRecordProto$Builder.mergeFrom(a:237)
       at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:394)
I did the scenario several times from scratch and faced this exact same error each time. I am unable to open any of the snapshots files.

Other information:
* I attempted to open the snapshot from different machines with YourKit 24.03, all resulted in the same error.
* I attempted to profile other applications in the same architecture (OS/RAM/Network/etc.) and succeeded. This server I am profiling now is the only that generates such issue.
Vladimir Kondratyev
Posts: 1659
Joined: Tue Aug 10, 2004 7:52 pm

Re: "Protocol message was too large" exception

Post by Vladimir Kondratyev »

Please do the following:

* Delete all files from ~/.yjp/log directory on the computer where you run profiler UI.

* Reproduce the exception.

* Send entire log file with the exception to support@yourkit.com

Best regards,
Vladimir Kondratyev
YourKit GmbH
http://www.yourkit.com
"Don't get lost in data, get information!"
llalexandru
Posts: 3
Joined: Wed Aug 21, 2024 8:25 am

Re: "Protocol message was too large" exception

Post by llalexandru »

Done.
Vladimir Kondratyev
Posts: 1659
Joined: Tue Aug 10, 2004 7:52 pm

Re: "Protocol message was too large" exception

Post by Vladimir Kondratyev »

Thank you for the log. We have just released version 2024.3.160, which should fix this issue. Please give it a try and confirm that the problem is resolved.

Best regards,
Vladimir Kondratyev
YourKit GmbH
http://www.yourkit.com
"Don't get lost in data, get information!"
llalexandru
Posts: 3
Joined: Wed Aug 21, 2024 8:25 am

Re: "Protocol message was too large" exception

Post by llalexandru »

2024.3.160 solved the problem. Thank you for support!
Locked