




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
memtester使用2010-08-16 18:20:21|分类: linux之路 |字号订阅 抄录一段官方的解释:A userspace utility for testing the memory subsystem for faults. Its portable and should compile and work on any 32- or 64-bit Unix-like system. (Yes, even weird, proprietary Unices, and even Mac OS X.) For hardware developers, memtester can be told to test memory starting at a particular physical address as of memtester version 4.1.0.操作步骤如下:rootlocalhost # wget http:/pyropus.ca/software/memtester/old-versions/memtester-4.2.0.tar.gzrootlocalhost # tar -xvf memtester-4.2.0.tar.gzrootlocalhost # cd memtester-4.2.0rootlocalhost # make & make installrootlocalhost memtester-4.2.0# vi READMEUsing memtester Usage is simple for the basic case. As root, run the resulting memtester binary with the following commandline: memtester runs An optional -p physaddr argument available to cause memtester to test memory starting at a specific physical memory address (by mmaping /dev/mem starting at an offset of physaddr, which is given in hex).#以上是节选,直接跟要测试的内存的大小就可以,默认单位是M,也可以手动指定为B, K, M, or G; -p参数是指定内存物理地址的。 For example, if you want to test a bank of RAM or device which is 64kbytes in size and starts at physical address 0x0C0000, you would run memtester as follows: memtester -p 0x0c0000 64k runsrootlocalhost memtester-4.2.0# memtester 256 memtester version 4.2.0 (32-bit)Copyright (C) 2010 Charles Cazabon.Licensed under the GNU General Public License version 2 (only).pagesize is 4096pagesizemask is 0xfffff000want 256MB (268435456 bytes)got 256MB (268435456 bytes), trying mlock .locked.Loop 1: Stuck Address : ok Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment: ok Solid Bits : ok Block Sequential : ok Checkerboard : ok Bit Spread : ok Bit Flip : ok Walking Ones : ok Walking Zeroes : ok 8-bit Writes : ok 16-bit Writes : ok注:测试结果仅仅截取了一部分。我测试的过程中,使用的机器内存为1G,swap分区为4G。首次测试时,将测试的内存大小指为1G,机器死机。个人认为是由于memtester将 内存全部占用导致的。运行memteste非常简单,作为root ./ memtester runs :内存大小,单位M runs:运行次数 这样我们就可以对单颗CPU的机器进行测试,查看内存是否足够稳定。 但如果我有多颗CPU和较大的memory呢?最简单的方法是多开几个终端,同时运行memtester,每个CPU分配同样大小的内存。 还有一种方法可以使用Baif编写的一个脚本memtester-multi.sh,位置放在memtester-4.0.7下就可以了。 这个脚本只在linux下有效! #!/bin/sh# Memory Tester Scripts# by Baif# version = dateVERSION=Fri Oct 19 11:56:57 CST 2007# trap for irruptionsMEMTESTER=$PWD/memtesterPPIDKILL=$SIDKILL=$trap pkill -9 -P $PPIDKILL;kill -9 $ INTtrap pkill -9 -P $PPIDKILL;kill -9 $ KILLcat &2Version: $VERSIONPID: $PPIDKILL: $PPIDKILLSIDKILL: $PPIDKILLEOF_vppsCORE_NUM=$(grep -i processor /proc/cpuinfo|wc -l)MEMTESTERCOPY=$CORE_NUMMEM_TOTAL_K=$(awk /MemTotal/print $2 /proc/meminfo)MEM_RESERVE_PERCENTAGE=$(1000*50/1024) # 95%MEM_RESERVED=$(MEM_TOTAL_K/1024*MEM_RESERVE_PERCENTAGE/1000)MEM_TOTAL_TOBETESTED=$(MEM_TOTAL_K/1024-MEM_RESERVED)MEM_PER_COPY=$(MEM_TOTAL_TOBETESTED/MEMTESTERCOPY)RUN_DURATION_TIME=0RUN_LOOPS=-1RUN_DURATION_TIME_FLAG=0RUN_LOOPS_FLAG=0DDPERCOPY_TIME=6sLOGDIR=/tmp/memtester-log-$mkdir -p $LOGDIRshow_help () cat &2Version: $VERSION Usage: $(basename $0) -r Directory: the root location of memtester binary file -c NUMBER: the copies of memtester should be run -m NUMBER: how many memory should be tested totally (in MB) -t TIME: duration mode, how long will the tests go -l NUMBER: loops mode,how many loops will each memtester should go The option -t and -l are exclusive, which means tests could work only with 1. duration mode or 2. loops mode RUN 4 copies memtester with in 24 hours, to test total 4000 MB memory: $(basename $0) -t 24h -c 4 -m 4000 RUN 2 copies memtester with in 1 hours, to test total 4000 MB memory: $(basename $0) -t 1h -c 4 -m 4000 RUN 4 copies memtester with in 2 loops, to test total 3600 MB memory: $(basename $0) -l 2 -c 4 -m 3600 -V/-h/-H: show this info. EOFshow_HELP exit 0while getopts:c:m:t:l:r:p:hHVvx OPTIONdo case $OPTION in c) #echo -c $OPTARG MEMTESTERCOPY=$OPTARG ; m) #echo -m $OPTARG MB MEM_TOTAL_TOBETESTED=$OPTARG MEM_RESERVED=$(MEM_TOTAL_K/1024-MEM_TOTAL_TOBETESTED) ; t) #echo -t $OPTARG 0 -ne $RUN_LOOPS_FLAG & echo -t and -l are exclusive. & exit 222 RUN_DURATION_TIME=$OPTARG RUN_DURATION_TIME_FLAG=1 ; l) #echo -l $OPTARG 0 -ne $RUN_DURATION_TIME_FLAG & echo & echo -t and -l are exclusive. & show_help & echo & exit 223 RUN_LOOPS=$OPTARG; RUN_LOOPS_FLAG=1 ; d) #echo -r $OPTARG MEMTESTER=$OPTARG/memtester ; p) #echo -p $OPTARG MEMTESTER=$OPTARG ; V|h|H) show_help ; v) set -v ; x) set -x ; ?) echo Error.; echo ?Unknown args. exit 224 ; *) #echo *Unknown args. esacdone#exit 0 -eq $RUN_DURATION_TIME_FLAG & 0 -eq $RUN_LOOPS_FLAG & echo & echo Please specified which mode should we run. -t or -l & show_help & echo & exit 225MEM_PER_COPY=$(MEM_TOTAL_TOBETESTED/MEMTESTERCOPY)echo Mem total: $(MEM_TOTAL_K/1024) MBecho Core total: $CORE_NUMecho Memtester copys: $MEMTESTERCOPYecho Mem per copy: $MEM_PER_COPYecho Mem total to used: $MEM_TOTAL_TOBETESTED MBif $MEM_RESERVED -lt 1 ;then echo Mem reserved: - No more memory reserved.else echo Mem reserved: $MEM_RESERVED MBfi#exit# GOGOGOif 0 -ne $RUN_DURATION_TIME_FLAG ; thenecho Run within a duration: $RUN_DURATION_TIMEelif 0 -ne $RUN_LOOPS_FLAG ;thenecho Run within a loop: $RUN_LOOPSfiecho Working directory: $PWDecho Memtester: $MEMTESTERecho LOGs directory: $LOGDIRechoecho -n Jobs started at date: date #+%Y/%m/%d %H:%Mecho#exit# Run testing within a duration time.if 0 -ne $RUN_DURATION_TIME_FLAG then# prepareing the sleeping killers sleep $RUN_DURATION_TIME echo -n End of testing(TIMEOUT). echo KILL CHILD & kill -9 $(pgrep -P $PPIDKILL memtester) & echo Childen processes - KILLED. # attention to how the memtesters are forked. echo KILL PARENT & kill $ & echo KILLED. & echo Finished the memtester echo -n Jobs finished at date: date #+%Y/%m/%d %H:%M fi &echo -n Waiting (PID: $) for $MEMTESTERCOPY memtesters($MEM_PER_COPYMB for each). if 0 -ne $RUN_DURATION_TIME_FLAG ;then echo -n For time: $RUN_DURATION_TIME fiif 0 -ne $RUN_LOOPS_FLAG ;then echo -n For loops: $RUN_LOOPS fiecho .while truedo MEMTESTER_NUM=0 echo -n while $MEMTESTER_NUM -lt $MEMTESTERCOPY do echo -n $MEMTESTER_NUM if 0 -ne $RUN_DURATION_TIME_FLAG then RUN_LOOPS=0 fi $MEMTESTER $MEM_PER_COPY $RUN_LOOPS 2&1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 无人机动态任务调整试题及答案
- 中级会计和审计的学习重点试题及答案
- 入团考试2025年互动交流试题及答案
- 中级会计考试中的态度与方法试题及答案
- 学习方法与中级审计师试题及答案分享
- 挖掘无人机飞行潜能的新思路试题及答案
- 运输合同解约协议书模板
- 初级护师考试护理优化试题及答案
- 审计与财务管理的联系与应用试题及答案
- 2025年中级会计考试全方位备考试题及答案
- 广西南宁建宁水务投资集团有限责任公司招聘笔试题库2025
- 乳腺癌防治知识手册运动与健康生活方式建议
- 2025年中国空调清洗市场竞争格局及行业投资前景预测报告
- 蓄水池水池清洗方案
- 空冷器、换热器设备试压方案
- 燃气管道及设施保护方案
- 企业绿色发展中的创新实践研究
- 2025中卫辅警考试题库
- 湖北省武汉市2025届高三下学期二月调研考试数学试卷
- 汉语语气词的语用功能分析论文
- 光伏材料与器件-深度研究
评论
0/150
提交评论