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 19, 2022
1 parent 027fa64 commit ce8391e
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().withNanoCPUs(2_000_000_000l));

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

Expand Down

0 comments on commit ce8391e

Please sign in to comment.