模拟java开发的高CPU负载 [英] simulate high cpu load for java development

查看:901
本文介绍了模拟java开发的高CPU负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Java应用程序,并希望看到它如何在较慢/重载的机器上运行。 (我怀疑可能会有一些线程不安全的问题等等被忽略,因为我的机器只是足够快地编译它。



有没有办法模拟高CPU负载/限制可用的CPU为Java应用程序?当然,我可以编写一个脚本实际上使我的CPU与各种任务重载,但我宁愿保持我的操作系统的其余运行顺利,不要过热我的机器,如果可能的话,有没有



我目前正在使用Eclipse Kepler作为我的IDE,但是如果另一个人可以自己做这个,那么他愿意切换。



编辑:我在Windows上工作,忘了澄清了:)

解决方案

使用 BES 节省您的CPU用于该特定的配置。



我会高度建议您限制内存使用量达到完全相同的目的。



请参阅这篇文章,以便在执行编译文件时传递最大内存使用量。


I'm developing a Java app and would like to see how it runs on slower/overloaded machines. (I suspect there may be some thread unsafe issues, etc. that get ignored because my machine just compiles it quickly enough.

Is there a way to simulate high CPU load/limit available CPU for the Java app? Of course, I could write a script to actually overload my CPU with various tasks, but I would prefer to keep the rest of my OS running smoothly and not overheat my machine, if possible. Is there an easy/known way to do this?

I am currently using Eclipse Kepler as my IDE, but would be willing to switch if another could do this natively.

EDIT: I'm working in Windows, forgot to clarify. :)

解决方案

Use BES to throttle your CPU for that specific prcocess.

I would highly recommend you limiting your memory usage for the exact same purpose.

See this post for a very easy way to pass in a maximum memory usage when you execute the compiled file.

这篇关于模拟java开发的高CPU负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆