JVMTI 提示和技巧

发布于 2024-12-21 10:31:31 字数 450 浏览 1 评论 0原文

我想做的是将quartz 的功能与jvmti 结合起来。基本上,我的计划是使用 jvmti 来监视内存使用情况,并在此基础上我将根据使用quartz 的优先级在 que 上启动/执行进程。我希望每个进程都以 this-process-will-execute-this-amount-of-timeslice 方法完成,以防止无响应,并能够处理所有传入的 java 进程,如 Web 请求。

我还没有在任何地方找到这个主题的教程(我能找到的教程很少,但对于像我这样的菜鸟来说还不够),这是 C 编程和 Java 编程的结合。我现在拥有的是带有c/c++插件的netbeans ide,虽然我还没有完成mingw的安装,但我想我可以处理这个问题,还有来自orasun的jvmti参考资料。

你们能指导我该怎么做吗?工具?参考资料?我可以查看/结帐现有的类似项目吗?我只是想加快这一速度,如果这里有人有类似的经历,会分享她/他的经历。

干杯!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿童谣 2024-12-28 10:31:31

当我继续编写 jvmti 代理的旅程时,我遇到了这个问题:

当我使用 java -agentpath:c:\path\to\agentlibdll\agentlib.dll javaclass 执行代理时

提示显示“找不到 Agent_OnLoad”。我用谷歌搜索线索(我总是这样做)并找到了一些我必须链接在一起的信息,结果是在构建代理 dll 时应该出现的参数(我正在使用 Windows 操作系统、netbeans IDE、mingw、msys)

我应该添加这一行:

-D_JNI_IMPLMENTATION_ -g -fno-strict-aliasing -fno-omit-frame-pointer -W -Wall -Wno-unused -Wno-parentheses -我。 - 共享

到项目属性(右键单击)>构建> c 和 c++ 编译器 >其他选项

我的命令行如下所示:

gcc -D_JNI_IMPLMENTATION_ -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

我只是想我应该分享我发现的东西。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文