linux下内存测试方法:
第一步:
free查看系统
/ # free
total used free shared buffers
Mem: 7688848 1477184 6211664 0 0
Swap: 0 0 0
Total: 7688848 1477184 6211664
上面free下面即为可用内存,单位byte;
第二步:
执行压力测试程序 ./stressapptest -s 多少秒 -M 多少M内存 &后台执行
/ # ./stressapptest -s 43200 -M 900 &
/ # Log: Commandline - ./stressapptest -s 43200 -M 900
Stats: SAT revision 1.0.1_autoconf, 32 bit binary
Log: root @ RAYS-0bedc0f6 on Sun Mar 14 18:59:09 UTC 2010 from open source release
Log: 1 nodes, 2 cpus.
Log: Defaulting to 2 copy threads
Log: Flooring memory allocation to multiple of 4: 900MB
Log: Using memaligned allocation at 0x3e7ed000.
Stats: Starting SAT, 900M, 43200 seconds
/ #
/ # Log: Seconds remaining: 41320
注意:1.如果执行程序失败,执行chmod 777 stressapptest ;2.所跑内存不要超过free后查看的可用内存; 3.如果内存比较大,跑多个900,加上剩余内存; 4.stressapptest压力测试程序为32位多线程内存测试程序,单个可执行程序可跑内存范围为0~1500开区间; 5.执行时间一般选12小时,执行完毕会有内存测试结果