Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:LinshunKang/MyPerf4J into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
LinShunKang committed Feb 11, 2019
2 parents 401c996 + c5f5bba commit 7082d5c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion MyPerf4J-Base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<version>2.22.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion MyPerf4J-Core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<version>2.22.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
9 changes: 1 addition & 8 deletions MyPerf4J-Core/src/test/java/MyPerf4J/JVMMemoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import cn.myperf4j.base.util.ThreadUtils;
import org.junit.Test;
import sun.misc.JavaNioAccess;
import sun.misc.SharedSecrets;
import sun.misc.VM;

import java.lang.management.*;
import java.nio.ByteBuffer;
Expand All @@ -18,8 +15,7 @@ public class JVMMemoryTest {

@Test
public void test() {
System.out.println("VM.maxDirectMemory=" + VM.maxDirectMemory() / 1024 / 1024 + "MB");
System.out.println("VM.maxDirectMemory=" + VM.maxDirectMemory());

printCurMem("Init");

allocate(1024 * 1024);
Expand Down Expand Up @@ -48,9 +44,6 @@ public void test() {
}

private void printCurMem(String desc) {
JavaNioAccess.BufferPool bufferPool = SharedSecrets.getJavaNioAccess().getDirectBufferPool();
System.out.println(desc + ": name=" + bufferPool.getName() + " count=" + bufferPool.getCount() + " memoryUsed=" + bufferPool.getMemoryUsed() + " totalCapacity=" + bufferPool.getTotalCapacity());

MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
MemoryUsage nonHeapMem = memoryMXBean.getNonHeapMemoryUsage();
System.out.println(desc + ": init=" + nonHeapMem.getInit() + ", max=" + nonHeapMem.getMax() + ", used=" + nonHeapMem.getUsed());
Expand Down

0 comments on commit 7082d5c

Please sign in to comment.