From ce8391e557825b5139d0ee4057dc892538c3083d Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Sat, 16 Apr 2022 14:49:37 +0100 Subject: [PATCH] Oracle DevServices: limit CPU to 2 to avoid excessive memory consumption --- .../oracle/deployment/OracleDevServicesProcessor.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/devservices/oracle/src/main/java/io/quarkus/devservices/oracle/deployment/OracleDevServicesProcessor.java b/extensions/devservices/oracle/src/main/java/io/quarkus/devservices/oracle/deployment/OracleDevServicesProcessor.java index 3062fe714ba1e..80889956024fd 100644 --- a/extensions/devservices/oracle/src/main/java/io/quarkus/devservices/oracle/deployment/OracleDevServicesProcessor.java +++ b/extensions/devservices/oracle/src/main/java/io/quarkus/devservices/oracle/deployment/OracleDevServicesProcessor.java @@ -45,6 +45,14 @@ public RunningDevServicesDatasource startDatabase(Optional 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();