Skip to content

Commit

Permalink
8327946: containers/docker/TestJFREvents.java fails when host kernel …
Browse files Browse the repository at this point in the history
…config vm.swappiness=0 after 8325139

According to the docker document(https://docs.docker.com/config/containers/resource_constraints/#--memory-swappiness-details), the default value of --memory-swappiness is inherited from the host machine.
So, when the the kervel config vm.swappiness=0 on the host machine, this testcase will fail, because of docker container can not use swap memory, the deafult value of --memory-swappiness is 0.

Signed-off-by: sendaoYan <yansendao.ysd@alibaba-inc.com>
  • Loading branch information
sendaoYan committed Mar 12, 2024
1 parent 139681a commit 480f336
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/hotspot/jtreg/containers/docker/TestJFREvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ private static void testSwapMemory(String memValueToSet, String swapValueToSet,
commonDockerOpts()
.addDockerOpts("--memory=" + memValueToSet)
.addDockerOpts("--memory-swap=" + swapValueToSet)
//The default memory-swappiness vaule is inherited from the host machine, which maybe 0
.addDockerOpts("--memory-swappiness=60")
.addClassOptions("jdk.SwapSpace"));
out.shouldHaveExitValue(0)
.shouldContain("totalSize = " + expectedTotalValue)
Expand Down

0 comments on commit 480f336

Please sign in to comment.