Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/vmEntry.cpp#L107 seems problematicly getting the wrong property java.vm.version #888

Closed
heoq opened this issue Feb 4, 2024 · 5 comments

Comments

@heoq
Copy link

heoq commented Feb 4, 2024

It seems that the correct property should be java.vm.specification.version now?

https://github.com/async-profiler/async-profiler/blob/master/src/vmEntry.cpp#L107

java.vm.compressedOopsMode Zero based
java.vm.specification.vendor Oracle Corporation
java.vm.specification.name Java Virtual Machine Specification
java.vm.vendor Eclipse Adoptium
java.vm.specification.version 21
java.vm.name OpenJDK 64-Bit Server VM
java.vm.info mixed mode, sharing
java.vm.version 21+35-LTS
@apangin
Copy link
Collaborator

apangin commented Feb 4, 2024

java.vm.version is the intended property. What's wrong with that?

@heoq
Copy link
Author

heoq commented Feb 4, 2024

@apangin Thanks for the quick response! On the version I mentioned above, running

profiler.sh --alloc 500k --live -d 60 <pid> -f test_live.collapsed

gave the error:

[ERROR] 'live' option is supported on OpenJDK 11+

@heoq
Copy link
Author

heoq commented Feb 4, 2024

I checked with a snippet that

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    printf("%d\n", atoi("21+35-LTS"));
    return 0;
}

does return 21. Maybe there is some other reason that I cannot profile live objects on Openjdk21

@apangin
Copy link
Collaborator

apangin commented Feb 4, 2024

What profiler version do you use?
profiler.sh suggests it's not the latest version, because there is no more profiler.sh in async-profiler 3.0.

Also, check grep asyncProfiler /proc/PID/maps if it contains multiple profiler versions already loaded into the process.

@heoq
Copy link
Author

heoq commented Feb 4, 2024

Yeah with with async profiler 3.0 in a clean enviroment I get the live alloc profile now. Maybe earlier I messed up some older version installed from the yum repo. Thank you for the help!

@heoq heoq closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants