将 DLL 加载到 java 中会导致 java.exe 中的 CPU 使用率增加吗?
我有一个加载 dll 的 java 小程序。该 dll 用于与第三方软件交互。该 dll 启动第三方软件,然后用于向该软件发送数据或从该软件接收数据。加载 dll 后,我们偶尔会看到 CPU 使用率激增。该峰值与 java.exe 相关,而不是与第三方软件相关。但是,峰值仅在加载 dll 后发生。这是对一个非常简单的问题的大量解释。是否有可能该 dll 本身正在消耗 CPU,并且这会在系统控制台上显示为 java.exe 消耗大量 CPU?
换句话说,考虑到 java.exe 似乎消耗大量 CPU,这可能是由加载的 dll 引起的吗?
谢谢你,
埃利奥特
I have a java applet that loads a dll. The dll is used to interface with a third party piece of software. The dll launches the third party software and then is used to send data to and receive data from that software. We occasionally are seeing a spike in CPU usage once the dll is loaded. The spike is associated with java.exe not with the third party software. But, the spike only occurs after the dll is loaded. This is a lot of explanation for a very simple question. Is it possible, that dll, itself could be consuming CPU and that this would show up on the system console as java.exe consuming a lot of CPU?
In other words, given a state where java.exe appears to be consuming a lot of CPU, could this be caused by a loaded dll?
Thank you,
Elliott
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,当加载 dll 时,它会被加载到进程中。 dll 使用的任何内存或 CPU 都会被报告为加载它的进程的一部分。如果 dll 函数在处理接收到的数据时导致 CPU 峰值,则会在加载该 dll 的应用程序下报告。
如果您有进程资源管理器,则可以打开进程的属性。右键单击进程并选择属性,然后转到属性对话框的线程选项卡。这可以显示每个线程的 CPU 使用情况,并且每个线程由映像(exe 或 dll)及其入口点来标识。
Yes, when a dll is loaded, it is loaded 'into' a process. Any memory or CPU used by the dll is reported as part of the process that loaded it. If a dll function spikes the CPU when processing received data, it will be reported under the application that loaded the dll.
If you have process explorer, you can open the properties of a process. Right-click a process and choose properties, then go to the threads tab of the properties dialog. This can show the CPU usage per thread, and each thread is identified by the image (exe or dll) and its entry point.