压力测试的Andr​​oid的Dalvik [英] Stress Testing Android Dalvik

查看:158
本文介绍了压力测试的Andr​​oid的Dalvik的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读了对Android的Dalvik,我很好奇,怎么一会去压力测试Dalvik的,以评估其稳定性。我理解的Dalvik是为内存处理器受限的设备。所以会分配大量内存/增加一些CPU内核的频率,然后启动多个应用程序来测试稳定的方式?

I've been reading up on the Android dalvik, and I was curious as to how one would go about stress testing the Dalvik to evaluate its stability. I understand the Dalvik is meant for memory an processor constrained devices. So would allocating a lot of memory/increasing frequency of some CPU cores and then launching multiple applications be a way to test the stability?

我也明白,每一个独立的程序得到itsown在Dalvik的实例。因此,另一种可能性强调的Dalvik将推出共享一个进程,并在Dalvik的一个实例,看到多个应用程序在Dalvik如何稳定的。

I also understand that each independent process gets itsown instance of the Dalvik. So another possibility to stress the Dalvik would be to launch multiple applications that share a single process and a single instance of the Dalvik and see how stable the Dalvik is.

我想知道如果任这些都是衡量的Dalvik的稳定性好方法。如果他们两人都是好办法,其中之一将是一个更好的测试?

I would like to to know if either of these are good ways to measure the stability of the Dalvik. If both of them are good ways, which one would be a better test?

谢谢!

推荐答案

这是很难一下子强调虚拟机的每一个部分。

It's difficult to stress every part of a VM all at once.

您可以编写锻炼堆和垃圾收集,同步压力测试(如JSR-166的java.util.concurrent测试套件)内存压力测试,CPU压力测试是做大量的整数和浮点计算同时不同的内核。等等。

You can write memory stress tests that exercise the heap and the garbage collector, synchronization stress tests (like the JSR-166 java.util.concurrent test suite), CPU stress tests that do lots of integer and floating-point computations on different cores simultaneously. And so on.

关键是要编写一个测试,做什么你觉得它 - 的多核心的测试数量惊人结束单线程的,因为意外的依赖关系 - 而其结果的正确性进行评估。除非这一事实传达给以某种方式在用户成功地导致不稳定的测试是没有用的。使得虚拟机崩溃是pretty好办法。 : - )

The trick is to write a test that does what you think it does -- a surprising number of "multi-core" tests end up single-threaded because of unexpected dependencies -- and whose results can be evaluated for correctness. A test that successfully causes instability isn't useful unless that fact is communicated to the user in some way. Making the VM crash is a pretty good way. :-)

在同一个进程中运行多个应用程序和服务在理论上是可行,但罕见的做法。我不认为你会真正能够强调制出任何这样更好,因为只有一个应用程序是在时间的前景,如果你正在做一个服务请求一个线程等待回应而其它线路。你最好还是先有一个应用程序使用多个线程,这样你就可以控制每个究竟是干什么的,以及它们如何相互作用。

Running multiple apps and services in the same process is theoretically possible but rare in practice. I don't think you'd actually be able to stress the system out any better this way, since only one app is in the foreground at a time, and if you're making requests of a service one thread will wait for the response while the other runs. You're better off just have one app with multiple threads, so you can control exactly what each does and how they interact.

在你可以做任何这一点,你需要定义的稳定的范围。只需运行许多应用程序是不会把任何东西,因为有数亿数十亿运行基本上没有故障,由于虚拟机本身(但任何数量的Dalvik的实例设备由于应用程序漏洞,框架,第3三方库等)。 Dalvik的没有由于Android 4.0(冰淇淋三明治)运两年前太大的改变。

Before you can do any of this, you need to define the scope of "stability". Simply running many apps isn't going to turn up anything, since there are hundreds of millions of devices running billions of instances of Dalvik with essentially no failures due to the VM itself (but any number due to bugs in apps, the framework, 3rd-party libraries, etc). Dalvik hasn't changed much since Android 4.0 (Ice Cream Sandwich) shipped two years back.

这篇关于压力测试的Andr​​oid的Dalvik的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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