0

what i want to do is to combine the power of quartz with jvmti. basically, my plan is to use jvmti to monitor memory usage and base on that i will launch / execute process on que depending on its priority using quartz. i want each process to be done in a this-process-will-execute-this-amount-of-timeslice approach to prevent non responsiveness and be able to handle all the incoming java processes like web request.

i havent found a tutorial in this topic anywhere (there are minimal that i can find but not enough for a noob like me), this is a combination of c programming and java programming. what i have at the moment is netbeans ide with c/c++ plugin, though i am not done yet with mingw installation but i think i can handle this and also a reference material of jvmti from orasun.

can you guys guide me on what to do? tools? reference materials? existing similar projects that i can look / checkout with? i just want to speedup this one and if someone here has this similar experience, would share her / his experiences.

cheers!

valiano
  • 16,433
  • 7
  • 64
  • 79
kowdphreak
  • 21
  • 2

1 Answers1

2

as i continue my journey on writing jvmti agents, i bumped into this problem:

when i execute my agent using java -agentpath:c:\path\to\agentlibdll\agentlib.dll javaclass

the prompt says "cannot find Agent_OnLoad". i googled for the clues ( i always does) and found pieces of information that i have to linked together, the result is a parameter that should be present upon building the agent dll (i am using windows OS, netbeans IDE, mingw, msys)

i should add this line:

-D_JNI_IMPLEMENTATION_ -g -fno-strict-aliasing -fno-omit-frame-pointer -W -Wall -Wno-unused -Wno-parentheses -I. -shared

to project properties (right click) > build > c and c++ compiler > additional options

my command line looks like this:

gcc -D_JNI_IMPLEMENTATION_ -g -fno-strict-aliasing -fno-omit-frame-pointer -W -Wall -Wno-unused -Wno-parentheses -I. -shared -shared -o dist/Debug/MinGW-Windows/libjvmticallbackc.dll build/Debug/MinGW-Windows/jvmticallbackc.o -L../../jdk.1.7.0/lib -ljawt -ljvm

i just thought i should share what i find.

kowdphreak
  • 21
  • 2