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..5af223b --- /dev/null +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/memory/MemoryCheck.java @@ -0,0 +1,15 @@ +package edu.harvard.dbmi.avillach.dictionary.memory; + +import jakarta.annotation.PostConstruct; +import org.springframework.stereotype.Service; + +@Service +public class MemoryCheck { + + @PostConstruct + public void checkMemory() { + long maxMemory = Runtime.getRuntime().maxMemory() / (1024 * 1024); + System.out.println("Max Heap Memory (Xmx): " + maxMemory + " MB"); + } + +}