Skip to content

Commit

Permalink
Oracle DevServices: limit CPU to 2 to avoid excessive memory consumption
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Apr 16, 2022
1 parent 3dc97c9 commit a7995ae
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public RunningDevServicesDatasource startDatabase(Optional<String> username, Opt
container.withUsername(username.orElse(DEFAULT_DATABASE_USER))
.withPassword(password.orElse(DEFAULT_DATABASE_PASSWORD))
.withDatabaseName(datasourceName.orElse(DEFAULT_DATABASE_NAME));

// We need to limit the maximum amount of CPUs being used by the container;
// otherwise the hardcoded memory configuration of the DB might not be enough to successfully boot it.
// See https://github.com/gvenzl/oci-oracle-xe/issues/64
// I choose to limit it to "2 cpus": should be more than enough for any local testing needs,
// and keeps things simple.
container.withCreateContainerCmdModifier(cmd -> cmd.getHostConfig().withCpuCount(2l));

additionalJdbcUrlProperties.forEach(container::withUrlParam);
container.start();

Expand Down

0 comments on commit a7995ae

Please sign in to comment.