[Solved] Need help with profiling in JME SDK

Hi friends

Installed Java Profiler plugin in SDK.
Then right click on main class and select “Profile file” and got this error :

Profiler Agent: Waiting for connection on port 5140, timeout 10 seconds (Protocol version: 16)
Profiler Agent Error: Timed out trying to establish connection with client
Profiler Agent: Initializing...
Profiler Agent: Options: >C:\Users\IDEA\AppData\Roaming\.jmonkeyplatform\3.1.0-beta1_xbuf-SNAPSHOT\lib,5140,10<
Profiler Agent: Initialized successfully
Profiler Agent: 250 classes cached.
Profiler Agent: 250 classes cached.
C:\Users\IDEA\AppData\Roaming\.jmonkeyplatform\3.1.0-beta1_xbuf-SNAPSHOT\var\cache\executor-snippets\profile.xml:64: Java returned: -1
BUILD FAILED (total time: 11 seconds)

Profile.xml : 

<project name="{0} (profile)" default="profile" basedir=".">
    <target name="-profile-check" if="netbeans.home">
        <condition property="profiler.configured">
                <contains string="${run.jvmargs.ide}" substring="-agentpath:" casesensitive="true"/>
                <contains string="${run.jvmargs.ide}" substring="-javaagent:" casesensitive="true"/>
    <target name="profile" depends="-profile-check" if="profiler.configured">
        <translate-classpath classpath="${classpath}" targetProperty="classpath-translated" />
        <property name="run.jvmargs" value="" />
        <property name="run.jvmargs.ide" value="" />
        <property name="work.dir" value="${basedir}"/>
        <property name="application.args" value="" />
        <property name="java.failonerror" value="true"/>

        <java classpath="${classpath-translated}" classname="${classname}" dir="${work.dir}" jvm="${platform.java}" fork="true" failonerror="${java.failonerror}">
            <jvmarg value="-Dfile.encoding=${encoding}"/>
            <redirector inputencoding="${encoding}" outputencoding="${encoding}" errorencoding="${encoding}"/>
            <jvmarg line="${run.jvmargs}" />
            <jvmarg line="${run.jvmargs.ide}"/>
            <arg line="${application.args}" />
                <propertyref prefix="run-sys-prop."/>
                <mapper from="run-sys-prop.*" to="*" type="glob"/>

Anybody used Profiler in JME SDK before ?

This is my first time want to use a profiler.

Any help is appreciated

1 Like

I used the profiler before but I simply clicked that button next to run/debug and let it profile everything. There were also some setings to choose.

“Java returned -1” sounds to an OS problem to me, have you retried it?
It essentially means that java couldn’t be launched for some reason (because the errorlevel is usually positive)

1 Like


Yep you were right. I tested it in another OS (Ubuntu) every thing is working.

It might be related to my Internet Security program in windows blocking port or something.

@Darkchaos FYI :

I retested it on nightly build of Netbeans (3/30/2016) on windows and it worked OK. Seems it is a bug.
[Netbeans 8.2] (NetBeans 82 - NetBeans Wiki) code will be released in Aug/26 so what do you think about updating JME SDK to 8.2 when released ?

I could try to do it, my free time starts at 19.9.16 though this is a few days before I start my bachelors thesis, so, time is short but we will see.

We actually don’t interfer with other plugins so you can only try to restart the plugin or something. Also see what your AV has listed jMonkeySDK under (could be different permissions than Netbeans and as a AV you can consider launching another java program fraud)

1 Like