java.lang.AssertionError:Docker环境的可用内存超过2GB

java.lang.AssertionError:Docker环境的可用内存超过2GB,java,docker,testing,out-of-memory,Java,Docker,Testing,Out Of Memory,我一直在为使用docker的程序创建测试。一切都很顺利,直到我在任何测试开始时突然遇到这个问题 ℹ︎ Checking the system... ✔ Docker version is newer than 1.6.0 ✘ Docker environment has more than 2GB free Test ignored. Test ignored. java.lang.AssertionError: Docker environment has more th

我一直在为使用docker的程序创建测试。一切都很顺利,直到我在任何测试开始时突然遇到这个问题

ℹ︎ Checking the system...
    ✔ Docker version is newer than 1.6.0
    ✘ Docker environment has more than 2GB free

Test ignored.

Test ignored.

java.lang.AssertionError: Docker environment has more than 2GB free

at org.rnorth.visibleassertions.VisibleAssertions.fail(VisibleAssertions.java:437)
at org.rnorth.visibleassertions.VisibleAssertions.assertTrue(VisibleAssertions.java:129)
at org.testcontainers.DockerClientFactory.checkDiskSpace(DockerClientFactory.java:168)
at org.testcontainers.DockerClientFactory.lambda$client$1(DockerClientFactory.java:127)
at org.testcontainers.DockerClientFactory.runInsideDocker(DockerClientFactory.java:230)
at org.testcontainers.DockerClientFactory.client(DockerClientFactory.java:118)
at org.testcontainers.containers.GenericContainer.<init>(GenericContainer.java:116)
at my.project.historyservice.MongoDBTest.<clinit>(MongoDBTest.java:24)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:156)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.get(Field.java:393)
at org.junit.runners.model.FrameworkField.get(FrameworkField.java:73)
at org.junit.runners.model.TestClass.getAnnotatedFieldValues(TestClass.java:230)
at org.junit.runners.ParentRunner.classRules(ParentRunner.java:255)
at org.junit.runners.ParentRunner.withClassRules(ParentRunner.java:244)
at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:194)
at org.junit.runners.ParentRunner.run(ParentRunner.java:362)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
第24行是我称之为“new GenericContainer”的行


我想不出有什么问题。我的电脑有16GB内存,其中10GB应该是免费的。在问题出现之前,我今天成功地运行了大约10次测试,我尝试重新启动计算机,但没有任何帮助。

它是检查您的磁盘空间,而不是RAM。谢谢!通过从磁盘中删除一些文件,我解决了这个问题。在我的情况下,即使我从磁盘中删除了文件,唯一有效的命令是:docker stop$(docker ps-a-q);docker kill$(docker ps-q);docker rm$(docker ps-a-q);docker rmi$(docker images-q)
public class MongoDBTest
{
  @ClassRule
  public static GenericContainer mongodb = new GenericContainer("mongo:3.6")
          .withExposedPorts(27017)
          .waitingFor(Wait.forListeningPort());