diff --git a/Dockerfile b/Dockerfile index 457f53e..d0dc7bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,4 +26,4 @@ ENV DATASOURCE_USERNAME=${DATASOURCE_USERNAME} ENV SPRING_PROFILE=${SPRING_PROFILE} # Default to no profile -ENTRYPOINT java $DEBUG_VARS $PROXY_VARS -Xmx8192m -jar /dictionary.jar --spring.profiles.active=${SPRING_PROFILE:-} \ No newline at end of file +ENTRYPOINT java $DEBUG_VARS $PROXY_VARS -Xmx8192m ${JAVA_OPTS} -jar /dictionary.jar --spring.profiles.active=${SPRING_PROFILE:-} \ No newline at end of file diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/memory/MemoryCheck.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/memory/MemoryCheck.java new file mode 100644 index 0000000..dd40e7f --- /dev/null +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/memory/MemoryCheck.java @@ -0,0 +1,19 @@ +package edu.harvard.dbmi.avillach.dictionary.memory; + +import jakarta.annotation.PostConstruct; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class MemoryCheck { + + private static final Logger LOG = LoggerFactory.getLogger(MemoryCheck.class); + + @PostConstruct + public void checkMemory() { + long maxMemory = Runtime.getRuntime().maxMemory() / (1024 * 1024); + LOG.info("Max Heap Memory (Xmx): {} MB", maxMemory); + } + +}