How can I use profiling tools on my project?

recrutaaeasyHOBBY

4 months ago

I'm currently using visualVM to create heapdumps and profile the memory usage on my local project, however, I wanted to use visualVM on my railway app as well. The problem i'm facing is creating a JMX connection that works, I already put jmx remote configurations on my app's properties. I'm using the public networking domain as the host, and the port I specified in the jmx remote configuration, but the VisualVM still gives me a "Not supported for this JVM" screen whenever I try to connect. Can I use ssh? Should I? Are there other ways or tools for profiling?

3 Replies

4 months ago

Hello,

I would recommend using the TCP Proxy to expose the JMX connection.


brody

Hello,I would recommend using the TCP Proxy to expose the JMX connection.

recrutaaeasyHOBBY

4 months ago

Hi! Thank you for the recommendation. I really think you're right, but would the configuration in my properties be like:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=1099 (Can I use the same port for both registry and rmi?)
-Dcom.sun.management.jmxremote.rmi.port=1099
-Djava.rmi.server.hostname=<MyProxyDomain>

Or would the rmi server hostname be my public non-proxy domain (my-app.up.railway.app)?

I feel my problem is mostly the ports and domains. Whenever I try to connect through JConsole it gives me the "non jrmp server at remote endpoint" error

Could you help me with this specific problem?

Thank you in advance!


4 months ago

You would need to connect to JMX via the public host and port of the tcp proxy.