DDR内存测试

参考:

https://blog.csdn.net/mijichui2153/article/details/81227590

https://blog.csdn.net/xwpc702/article/details/86233621

https://blog.csdn.net/qwaszx523/article/details/52537363

https://zsmith.co/bandwidth.php#download

 

一、压力测试

stressapptest:源码下载 
http://mirror.its.dal.ca/debian/pool/main/s/stressapptest/

https://github.com/stressapptest/stressapptest

 

DDR内存测试

从上图可以看出StressTestUtils是和开发者打交道的最主要的类;

 

stressapptest Android代码位置 alps\external\stressapptest

将stressapptest push到system/bin目录下:

./stressapptest -s 86400 -m 4 -i 4 -c 4 -C 4 -M xxx      
It is to stress test memory copy, invert, crc check for 1hour with 900Mb memory.       
-s: number of second to run the application  测试时间      
-m: number of memory copy threads to run  复制线程数  (Memory Copy)    
-i: number of memory invert threads to run  反转线程数 (Invert Copy)   
-c: CRC check  CRC校验                                 (Data Check)
-C: number of memory CPU stress threads to run    CPU压力线程数      
-M: Megabytes of ram to run  尽可能测试最大的可用存储空间,(设置超过了memfree,就会被kill) 

 

 批量测试:

@echo off
set testTimeInsecond=1800
set mbytes=400
set threads=8

@echo off 
echo CONNECTED....
:NOCONNECTED
@echo off

setlocal enabledelayedexpansion
set devices=
for /f "tokens=1,3,5,7,9,11,13,15,17 skip=1" %%t in ('adb devices') do (
set "devices=!devices! %%t"
)
echo devices
for %%d in (%devices%) DO adb -s %%d root
for %%d in (%devices%) DO start adb -s %%d shell stressapptest -s %testTimeInSecond% -M %mbytes% -m %threads% -W -l /sdcard/memtest.log
pause

 

二、内存宽带测试

参考:

https://blog.csdn.net/lux_veritas/article/details/24766015

https://zsmith.co/bandwidth.php#download

用于读写的数据块大小从128B逐渐增大到128MB,由于各级cache的大小不同,进行内存读写时,较小的数据块会存放在cache中,较大的数据块则会经过cache存放在主存中。所以,随着数据块大小的增加,在几个节点上带宽的大小会有明显的跳变,主要原因就是到达了各级cache的容量上限,而转向下层存储。bandwidth会将测试结果生成一个日志文件,一张图表,这种带宽的跳变在图表中有最直观的表现。如图,在32KB与4MB处带宽有明显的下降趋势

 

DDR内存测试

Revision 37 
© 2012-2019 by Zack Smith. All rights reserved.

Download

Introduction

My program, called simply bandwidth, is an artificial benchmark primarily for measuring memory bandwidth on x86 and x86_64 based computers, useful for identifying weaknesses in a computer's memory subsystem, in the bus architecture, in the cache architecture and in the processor itself.

bandwidth also tests some libc functions and, under GNU/Linux, it attempts to test framebuffer memory access speed if the framebuffer device is available.

This program is open source and covered by the GPL license. Although I wrote it mainly for my own benefit, I am also providing it pro bono, i.e. for the public good.