MemTest86

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MemTest86相关的知识,希望对你有一定的参考价值。

参考技术A

MemTest86 was originally developed by Chris Brady (BradyTech Inc) with a first release in 1994.

However, some of the testing algorithms used have been under development since 1981 and have been previously implemented on Dec PDP-11, VAX-11/780 and Cray XMP architectures.

Since then there has been more than a dozen new versions being released. Support for 64bit, new CPU types, symmetrical multiprocessors and many other features have been added during this period.

MemTest86 was released as free open source (GPL) software.

被不同人发展出来了一系列的版本,所谓是百花齐放百家争鸣且螺旋式优化改进啊~

新时代(64bit、DDR4)的到来,面临新的挑战。
In Feb 2013, PassMark Software took over the maintenance of the MemTest86 project from Chris.

This was around the time that a lot of technological changes were occurring. The 64bit era was here, DDR4 was coming, UEFI had already arrived and Microsoft\'s Secure boot technology threatened to prevent MemTest86 from booting on future PC hardware.

Starting from MemTest86 v5, the code was re-written to support self booting from the newer UEFI platform. UEFI is able to provide additional services that is unavailable in Bios, such as graphical, mouse and file system support. Support for DDR4 & 64bit were also added and Microsoft agreed to code sign MemTest86 for secure boot.

The software (Free Edition) still remains free to use without restrictions. The MemTest86 v4 project is still maintained and remains open source, for use on old machines with BIOS. From V5 however the software is being released under a proprietary license. For advanced/enthusiast users or commercial applications, a professional version is available for users that require additional customizability and advanced features that may be more suitable for their testing needs. A comparison of the different versions can be found here. We have also created a support forum where users can discuss issues.

这里是它的发布历史轨迹

MemTest86 is the original, free, stand alone memory testing software for x86 computers. MemTest86 boots from a USB flash drive or CD and tests the RAM in your computer for faults using a series of comprehensive algorithms and test patterns .

特点:(就关注这两点)

By running MemTest, you can ensure that your computers RAM is correctly functioning .

Unlike other memory checking software, MemTest is designed to find all types of memory errors including intermittent problems.

Therefore, it needs to be run for several hours to truly evaluate your RAM. MemTest works with any type of memory.

Test 0 [Address test, walking ones, no cache]
Tests all address bits in all memory banks by using a walking ones address pattern.

Test 1 [Address test, own address]
Each address is written with its own address and then is checked for consistency. In theory previous tests should have caught any memory addressing problems. This test should catch any addressing errors that somehow were not previously detected.

Test 2 [Moving inversions, ones&zeros]
This test uses the moving inversions algorithm with patterns of all ones and zeros. Cache is enabled even though it interferes to some degree with the test algorithm. With cache enabled this test does not take long and should quickly find all "hard" errors and some more subtle errors. This test is only a quick check.

Test 3 [Moving inversions, 8 bit pat]
This is the same as test one but uses a 8 bit wide pattern of "walking" ones and zeros. This test will better detect subtle errors in "wide" memory chips. A total of 20 data patterns are used.

Test 4 [Moving inversions, random pattern]
Test 4 uses the same algorithm as test 1 but the data pattern is a random number and it\'s complement. This test is particularly effective in finding difficult to detect data sensitive errors . A total of 60 patterns are used. The random number sequence is different with each pass so multiple passes increase effectiveness.

Test 5 [Block move, 64 moves]
This test stresses memory by using block move (movsl) instructions and is based on Robert Redelmeier\'s burnBX test. Memory is initialized with shifting patterns that are inverted every 8 bytes. Then 4mb blocks of memory are moved around using the movsl instruction. After the moves are completed the data patterns are checked. Because the data is checked only after the memory moves are completed it is not possible to know where the error occurred. The addresses reported are only for where the bad pattern was found. Since the moves are constrained to a 8mb segment of memory the failing address will always be less than 8mb away from the reported address. Errors from this test are not used to calculate BadRAM patterns.

Test 6 [Moving inversions, 32 bit pat]
This is a variation of the moving inversions algorithm that shifts the data pattern left one bit for each successive address. The starting bit position is shifted left for each pass. To use all possible data patterns 32 passes are required. This test is quite effective at detecting data sensitive errors but the execution time is long.

Test 7 [Random number sequence]
This test writes a series of random numbers into memory. By resetting the seed for the random number the same sequence of number can be created for a reference. The initial pattern is checked and then complemented and checked again on the next pass. However, unlike the moving inversions test writing and checking can only be done in the forward direction.

Test 8 [Modulo 20, ones&zeros]
Using the Modulo-X algorithm should uncover errors that are not detected by moving inversions due to cache and buffering interference with the the algorithm. As with test one only ones and zeros are used for data patterns.

Test 9 [Bit fade test, 90 min, 2 patterns]
The bit fade test initializes all of memory with a pattern and then sleeps for 90 minutes. Then memory is examined to see if any memory bits have changed. All ones and all zero patterns are used. This test takes 3 hours to complete. The Bit Fade test is not included in the normal test sequence and must be run manually via the runtime configuration menu.

Error Display
Memtest has two options for reporting errors. The default is to report individual errors. Memtest is also able to create patterns used by the Linux BadRAM feature. This slick feature allows Linux to avoid bad memory pages. Details about the BadRAM feature can be found at: http://home.zonnet.nl/vanrein/badram

For individual errors the following information is displayed when a memory error is detected. An error message is only displayed for errors with a different address or failing bit pattern. All displayed values are in hexadecimal.

Tst: Test Number

Failing Address: Failing memory address

Good: Expected data pattern

Bad: Failing data pattern

Err-Bits: Exclusive or of good and bad data (this shows the position of the failing bit(s))

Count: Number of consecutive errors with the same address and failing bits Error Display

Troubleshooting Memory Errors
Please be aware that not all errors reported by Memtest86 are due to bad memory.
The test implicitly tests the **CPU, L1 and L2 caches as well as the motherboard. **

It is impossible for the test to determine what causes the failure to occur. However, most failures will be due to a problem with memory. When it is not, the only option is to replace parts until the failure is corrected.

出问题时按下面步骤来定温问题:
there are steps that may be taken to determine the failing module. Here are four techniques that you may wish to use:

兼容问题导致异常。

Memtest86 can not diagnose many types of PC failures. For example a faulty CPU that causes Windows to crash will most likely just cause Memtest86 to crash in the same way.

The time required for a complete pass of Memtest86 will vary greatly depending on CPU speed, memory speed and memory size. Here are the execution times from a Pentium-II-366 with 64mb of RAM:
Test 0 0:05
Test 1 0:18
Test 2 1:02
Test 3 1:38
Test 4 8:05
Test 5 1:40
Test 6 4:24
Test 7 6:04
Total (default tests) 23:16

Test 8 12:30
Test 9 49:30
Test 10 30:34
Test 11 3:29:40
Total (all tests) 5:25:30

Memtest86 continues executes indefinitely. The pass counter increments each time that all of the selected tests have been run. Generally a single pass is sufficient to catch all but the most obscure errors. However, for complete confidence when intermittent errors are suspected testing for a longer period is advised.

Memory Testing Philosophy
There are many good approaches for testing memory. However, many tests simply throw some patterns at memory without much thought or knowledge of the memory architecture or how errors can best be detected. This works fine for hard memory failures but does little to find intermittent errors.

Memory chips consist of a large array of tightly packed memory cells, one for each bit of data. The vast majority of the intermittent failures are a result of interaction between these memory cells. Often writing a memory cell can cause one of the adjacent cells to be written with the same data. An effective memory test should attempt to test for this condition. Therefore, an ideal strategy for testing memory would be the following:

It should be obvious that this strategy requires an exact knowledge of how the memory cells are laid out on the chip.

In addition there is a never ending number of possible chip layouts for different chip types and manufacturers making this strategy impractical. However, there are testing algorithms that can approximate this ideal.

Memtest86 uses two algorithms that provide a reasonable approximation of the ideal test strategy above.

解决相邻cell互相影响的问题。

The first of these strategies is called moving inversions. The moving inversion test works as follows:

This algorithm is a good approximation of an ideal memory test but there are some limitations . Most high density chips today store data 4 to 16 bits wide. With chips that are more than one bit wide it is impossible to selectively read or write just one bit. This means that we cannot guarantee that all adjacent cells have been tested for interaction. In this case the best we can do is to use some patterns to insure that all adjacent cells have at least been written with all possible one and zero combinations.

It can also be seen that caching, buffering and out of order execution will interfere with the moving inversions algorithm and make less effective. It is possible to turn off cache but the memory buffering in new high performance chips can not be disabled. To address this limitation a new algorithm I call Modulo-X was created. This algorithm is not affected by cache or buffering. The algorithm works as follows:

This algorithm accomplishes nearly the same level of adjacency testing as moving inversions but is not affected by caching or buffering.

Since separate write passes (1a, 1b) and the read pass (1c) are done for all of memory we can be assured that all of the buffers and cache have been flushed between passes. The selection of 20 as the stride size was somewhat arbitrary.

Larger strides may be more effective but would take longer to execute. The choice of 20 seemed to be a reasonable compromise between speed and thoroughness.

Memtest86 executes a series of numbered test sections to check for errors.

These test sections consist of a combination of test algorithm, data pattern and cache setting .

The execution order for these tests were arranged so that errors will be detected as rapidly as possible.

Tests 8, 9, 10 and 11 are very long running extended tests and are only executed when extended testing is selected.

The extended tests have a low probability of finding errors that were missed by the default tests.

A description of each of the test sections follows:

Tests all address bits in all memory banks by using a walking ones address pattern.

This test uses the moving inversions algorithm with patterns of only ones and zeros.

Cache is enabled even though it interferes to some degree with the test algorithm. With cache enabled this test does not take long and should quickly find all "hard" errors and some more subtle errors. This test is only a quick check.

Each address is written with its own address and then is checked for consistency.

In theory previous tests should have caught any memory addressing problems. This test should catch any addressing errors that somehow were not previously detected.

This is the same as test one but uses a 8 bit wide pattern of "walking" ones and zeros. This test will better detect subtle errors in "wide" memory chips.

A total of 20 data patterns are used.

This is a variation of the moving inversions algorithm that shifts the data pattern left one bit for each successive address.

The starting bit position is shifted left for each pass. To use all possible data patterns 32 passes are required.

This test is effective in detecting** data sensitive** errors in "wide" memory chips.

This test stresses memory by using block move (movsl) instructions and is based on Robert Redelmeier\'s burnBX test.

Memory is initialized with shifting patterns that are inverted every 8 bytes. Then 4mb blocks of memory are moved around using the movsl instruction.

After the moves are completed the data patterns are checked. Because the data is checked only after the memory moves are completed it is not possible to know where the error occurred.

The addresses reported are only for where the bad pattern was found. Since the moves are constrained to a 8mb segment of memory the failing address will always be less than 8mb away from the reported address. Errors from this test are not used to calculate BadRAM patterns.

Using the Modulo-X algorithm should uncover errors that are not detected by moving inversions due to cache and buffering interference with the the algorithm. As with test one only ones and zeros are used for data patterns.

This is the same as test one but without cache. With cache off there will be much less interference with the test algorithm. However, the execution time is much, much longer. This test may find very subtle errors missed by previous tests.

This is the first extended test. This is the same as test #5 except that we do more memory moves before checking memory. Errors from this test are not used to calculate BadRAM patterns.

By using an 8 bit pattern with cache off this test should be effective in detecting all types of errors. However, it takes a very long time to execute and there is a low probability that it will detect errors not found by the previous tests.

This is the first test to use the Modulo-X algorithm with a data pattern other than ones and zeros. This combination of algorithm and data pattern should be quite effective. However, it\'s very long execution time relegates it to the extended test section.

This test should be the most effective in finding errors that are data pattern sensitive. However, without cache it\'s execution time is excessively long.

tomcat进阶操作

 

1、使用war包部署web站点

[[email protected] webapps]# pwd

/application/tomcat/webapps

[[email protected] webapps]# rz     #上传memtest.war,上传的是网上下载编译好的java项目

[[email protected] webapps]# ls        #等待一会儿就会解压war

docs examples host-manager manager memtest memtest.war ROOT

浏览器访问http://10.0.0.7:8080/memtest

 

2、tomcat auth basic认证的实现

为站点的某个路径配置认证

2.1 修改tomcat的conf目录下的tomcat-users.xml文件

添加角色用户名和密码

[[email protected] ~]# vim /application/tomcat/conf/tomcat-users.xml

…………

<role rolename="manager-gui"/>

<role rolename="admin-gui"/>

<user username="tomcat" password="tomcat" roles="manager-gui,admin-gui"/>

</tomcat-users> #→在此行前加入上面三行

2.2 修改myapp/WEB-INF/web.xml文件

这个文件的内容可以效仿系统自带的manager页面认证的配置文件/application/tomcat/webapps/manager/WEB-INF/web.xml进行配置

[[email protected] jpress]# vim WEB-INF/web.xml

<security-constraint>

<web-resource-collection>

<web-resource-name>HTML Manager interface (for humans)</web-resource-name>

<url-pattern>/admin/*</url-pattern>

</web-resource-collection>

<auth-constraint>

<role-name>manager-gui</role-name>

</auth-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

<realm-name>Jpress admin</realm-name>

</login-config>

[[email protected] jpress]# /application/tomcat/bin/shutdown.sh        #重启tomcat

[[email protected] jpress]# /application/tomcat/bin/startup.sh

访问网站admin路径时就需要认证

 

3、自定义默认网站目录

[[email protected] ~]# vim /application/tomcat/conf/server.xml

<Host name="localhost" appBase="webapps"

unpackWARs="true" autoDeploy="true">

<Context path="" docBase="/application/tomcat/webapps/memtest" debug="0" reloadable="false" crossContext="true"/>

[[email protected] ~]# /application/tomcat/bin/shutdown.sh        #重启tomcat

[[email protected] ~]# /application/tomcat/bin/startup.sh

访问http://10.0.0.7:8080即可访问到网站

 

4、tomcat多实例及集群架构

4.1 tomcat多实例

4.1.1 复制tomcat目录

[[email protected] ~]# cd /application/

[[email protected] application]# cp -a apache-tomcat-8.0.27 tomcat8_1

[[email protected] application]# cp -a apache-tomcat-8.0.27 tomcat8_2

4.1.2 修改配置文件

[[email protected] application]# mkdir -p /data/www/www/ROOT

[[email protected] application]# cp /application/tomcat/webapps/memtest/meminfo.jsp /data/www/www/ROOT/

[[email protected] ~]# sed -i ‘22s#8005#8011#;69s#8080#8081#;123s#appBase=".*"# appBase="/data/www/www"#‘ /application/tomcat8_1/conf/server.xml

[[email protected] ~]# sed -i ‘22s#8005#8012#;69s#8080#8082#;123s#appBase=".*"# appBase="/data/www/www"#‘ /application/tomcat8_2/conf/server.xml

[[email protected] ~]# diff /application/tomcat/conf/server.xml /application/tomcat8_1/conf/server.xml

22c22

< <Server port="8005" shutdown="SHUTDOWN">

---

> <Server port="8011" shutdown="SHUTDOWN">

69c69

< <Connector port="8080" protocol="HTTP/1.1"

---

> <Connector port="8081" protocol="HTTP/1.1"

123c123

< <Host name="localhost" appBase="/application/tomcat/webapps/memtest"

---

> <Host name="localhost" appBase="/data/www/www"

[[email protected] ~]# diff /application/tomcat/conf/server.xml /application/tomcat8_2/conf/server.xml

22c22

< <Server port="8005" shutdown="SHUTDOWN">

---

> <Server port="8012" shutdown="SHUTDOWN">

69c69

< <Connector port="8080" protocol="HTTP/1.1"

---

> <Connector port="8082" protocol="HTTP/1.1"

123c123

< <Host name="localhost" appBase="/application/tomcat/webapps/memtest"

---

> <Host name="localhost" appBase="/data/www/www"

4.1.3 启动多实例

for i in {1..2};do /application/tomcat8_$i/bin/startup.sh;done

netstat -tunlp|grep java

4.2 tomcat集群

使用nginx+tomcat反向代理集群

[[email protected] ~]# vim /application/nginx/conf/nginx.conf

upstream web_pools {

server 127.0.0.1:8081;

server 127.0.0.1:8082;

}

server {

listen 80;

server_name localhost;

location / {

root html;

index index.jsp index.html index.htm;

proxy_pass http://web_pools;

}

}

[[email protected] ~]# /application/nginx/sbin/nginx -t

[[email protected] ~]# /application/nginx/sbin/nginx

浏览器直接访问ip地址即可访问到网站

 

5、tomcat优化

5.1 安全优化

降权启动

telnet管理端口保护

ajp连接端口保护

禁用管理端

5.2 性能优化

5.2.1 屏蔽dns查询enableLookups="false"

<Connector port="8081" protocol="HTTP/1.1"

connectionTimeout="6000" enableLookups="false" acceptCount="800"

redirectPort="8443" />

5.2.2 jvm调优

Tomcat较耗内存,如果系统资源有限,那就需要进行调优,提高资源使用率

1、增加最大连接数

2、调整工作模式

3、启用gzip压缩

4、调整JVM内存大小

5、作为Web时,动静分离

6、合理选择垃圾回收算法

7、尽量使用较新JDK版本

优化catalina.sh配置文件。在catalina.sh配置文件中添加以下代码:

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1024m -Xmx1024m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=512m -XX:MaxPermSize=512m"

server:一定要作为第一个参数,在多个CPU时性能佳

-Xms:初始堆内存Heap大小,使用的最小内存,cpu性能高时此值应设的大一些

-Xmx:初始堆内存heap最大值,使用的最大内存

上面两个值是分配JVM的最小和最大内存,取决于硬件物理内存的大小,建议均设为物理内存的一半。

-XX:PermSize:设定内存的永久保存区域

-XX:MaxPermSize:设定最大内存的永久保存区域

-XX:MaxNewSize:

-Xss 15120 这使得JBoss每增加一个线程(thread)就会立即消耗15M内存,而最佳值应该是128K,默认值好像是512k.

+XX:AggressiveHeap 会使得 Xms没有意义。这个参数让jvm忽略Xmx参数,疯狂地吃完一个G物理内存,再吃尽一个G的swap。

-Xss:每个线程的Stack大小

-verbose:gc 现实垃圾收集信息

-Xloggc:gc.log 指定垃圾收集日志文件

-Xmn:young generation的heap大小,一般设置为Xmx的3、4分之一

-XX:+UseParNewGC :缩短minor收集的时间

-XX:+UseConcMarkSweepGC :缩短major收集的时间

 

参考来源:http://blog.oldboyedu.com/java-tomcat/

Tomcat性能调优及JVM内存工作原理可参考:

https://mp.weixin.qq.com/s/SMleZksgillAEA1xYHQn5g

以上是关于MemTest86的主要内容,如果未能解决你的问题,请参考以下文章

监控tomcat状态

tomcat监控

监控Tomcat状态

开发工具mtestuboot内存检测工具(mtest)的使用

关于ubuntu 10.10中的initramfs问题,高手来啊--

监控Tomcat状态!