Profiling of java under maxmsp

Jan 25, 2006 at 10:37am

Profiling of java under maxmsp

Hi,

does anyone of you tried to run a profiler (as JProfiler for e.g)
against a running mxj on maxmsp ?

The key is to setup the parameters of jvm I think…

Regards,
Chris

#24087
Jan 27, 2006 at 6:55am

Hi Kris,

I have been able to successfully run jprofiler from a Mac, but haven’t figured out how to do it on a Windows machine yet. Below is the contents of the max.java.config.txt file I use.

Ben

; This is the config used by Max when instantiating the JVM ;
; Comments are enclosed within 2 semicolons ;

; The file format is relatively fragile so pay attention ;
; when editing this file !! ;

; some example options one may use ;

; add all jars in /Users/topher/java/lib to the system classpath i.e. immutable classpath ;
; max.system.jar.dir /Users/topher/java/lib;

; add /Users/topher/foo to the system classpath i.e. immutable classpath ;
; max.system.class.dir /Users/topher/foo ;

; these next 2 are typically what you would want to use if you want additional directories ;
; added to your classpath for max ;

; add /Users/topher/myclasses to the dynamic classpath of MXJClassLoader ;
; max.dynamic.class.dir /Users/topher/myclasses ;

; add all jars in /Users/topher/myjars to the dynamic classpath of MXJClassLoader ;
max.dynamic.jar.dir c74:/java/classes

; specify some jvm options ;
max.jvm.option -Xincgc
max.jvm.option -Xms16m
max.jvm.option -Xmx256m
max.jvm.option -Xloggc:/Users/bbn/MAX.GC.LOG

;jprofiler stuff ;

max.jvm.option -Xint
max.jvm.option -Xrunjprofiler:port=8862
max.jvm.option -XX:-UseSharedSpaces
max.jvm.option -Xbootclasspath/a:/Applications/jprofiler3/bin/agent.jar

; max.jvm.option -Xnoclassgc;
; this option tells the classloader whether or not to always load mxj classes from disk ;
;obviously loading from disk is slower but it is very useful during development of an mxj ;
; class since you do not have to restart max or send the _zap message to mxj everytime a compiled ;
; class changes ;

mxj.classloader.fromdisk 1

;1 = compatible mode, 2 = hi performance mode, 3 = ben affleck mode;
mxj.msp.mode 2

#69139
Jan 27, 2006 at 10:38am

Thanks very much, I’ll try it.

Regards,
Chris

#69140
Jan 27, 2006 at 10:58am

Hi,

what is
;1 = compatible mode, 2 = hi performance mode, 3 = ben affleck mode;
mxj.msp.mode 2

does a doc exists with explanations about differents options?

Thanks,Chris

#69141
Jan 29, 2006 at 1:24am

Those modes relate to the way mxj~ executes its perform routine.
Ben Affleck mode is currently unsupported. I could never get it to work properly. Basically it involved a lot of seat of the pants jvm hacking that increased performance but in the end failed due to the java GC freaking out when we passed in references to fake objects. Hi performance mode is the default.
Topher

#69142
Jan 30, 2006 at 12:00am

Hi,

ok, thanks, I forgot about these options.

Chris
> Those modes relate to the way mxj~ executes its perform routine.
> Ben Affleck mode is currently unsupported. I could never get it to work properly. Basically it involved a lot of seat of the pants jvm hacking that increased performance but in the end failed due to the java GC freaking out when we passed in references to fake objects. Hi performance mode is the default.
> Topher
>
>

#69143
Jan 30, 2006 at 12:02am

Hi,
it is alwways leading to a crash because libjprofiler.jnilib is not in
the search path for jnilib.
When I put it in the path indicated in the error message, it doesn’t
change anything.

(JProfiler 4)

I’ll ask for support from EJ Technologies tomorrow, they should know
the solution.

Regards,
CHris

#69144
Feb 2, 2006 at 2:33pm

hi,

jprofiler is working fine now…

we also need to add this (info from ej-technologies):

On OS X, you have to add environment variables to
~/.MacOSX/environment.plist
for general availability (i.e. for programs not started with a shell).

file content:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE plist SYSTEM
“file://localhost/System/Library/DTDs/PropertyList.dtd”>


DYLD_LIBRARY_PATH
/Applications/jprofiler4/bin/macos

then, it is working nearly fine. i have some minor issues at jprofiler
startup.

i used the following options in max java conf file
max.java.jvm.version 1.5
max.jvm.option -Xint
max.jvm.option -agentlib:jprofilerti=port=8849
max.jvm.option -Xbootclasspath/a:/Applications/jprofiler4/bin/agent.jar

(i put them first)

this option is making errors:
max.jvm.option -Xincgc

regards,
chris

#69145

You must be logged in to reply to this topic.