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

Don't return service in list of profilable JVM processes #21

Open
Byte-Lab opened this issue Jul 31, 2016 · 5 comments
Open

Don't return service in list of profilable JVM processes #21

Byte-Lab opened this issue Jul 31, 2016 · 5 comments
Assignees
Labels

Comments

@Byte-Lab
Copy link
Owner

Currently when you query a service for a list of JCozVMDescriptors, it also sends itself as an available process. We should not include the service in this list.

@Byte-Lab
Copy link
Owner Author

Hey @RichardH92 , I'm working on getting the build system working in #17 so we can easily build and run JCoz. Once that's done, this might be a good starter bug for you

@Byte-Lab
Copy link
Owner Author

The basic idea here is that when the RMI service uses the VirtualMachine API to find a list of processes (see https://github.com/Decave/JCoz/blob/master/src/java/src/main/java/com/vernetperronllc/jcoz/service/JCozServiceImpl.java#L68), it should not return itself in that list. We are also going to need a way to determine which of those services is running with the JCoz native agent and only return those rather than any other JVM process.

@Byte-Lab
Copy link
Owner Author

Note that #24 is slightly different from this bug because we should not be returning the same RMI service even if for some reason it is being profiled by JCoz.

@RichardH92
Copy link
Collaborator

RichardH92 commented Aug 9, 2017

So, I have been researching. I think to accomplish this and the other related issue #24, we will need to use System.setProperty("process.unique.id", uniqueId); to assign the processes a unique PID.

Then, when calling VirtualMachine.list() we will know which process is which.

https://gist.github.com/deckerego/7826661

@Byte-Lab
Copy link
Owner Author

Nice, that should work. You'll have to figure out how to call it (or something equivalent) from the native JVMTI layer. Something along the lines of http://www.hildstrom.com/projects/jni/index.html should work. You don't have to create the JNI environment - you can just call it from here: https://github.com/Decave/JCoz/blob/master/src/native/entry.cc#L229. Hopefully the SecurityManager won't get in your way.

Also, let's name the property something unique to JCoz, like System.setProperty("process.jcoz.enabled", JNI_TRUE); just to keep namespaces separate.

Byte-Lab added a commit that referenced this issue Oct 5, 2019
Fixes #21

Once upon a time, it was under consideration
to try and monetize JCoz. This is no longer
the case, and JCoz is free and open source
under the permissions afforded by the GPL.
This change therefore removes references to
vernetperronllc, and restructures the layout
of the Java portion of JCoz accordingly.

Testing Done: Verified that java and tests
make targets can still be built, and that
docker image can still be built.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants