Skip to content

Commit

Permalink
Merge pull request #25009 from Sanne/OracleDevImprovements2
Browse files Browse the repository at this point in the history
Oracle DevServices: limit CPU to 2 to avoid excessive memory consumption
  • Loading branch information
Sanne authored Apr 20, 2022
2 parents 955ba30 + ce8391e commit 731abc3
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 731abc3

Please sign in to comment.