From c5116bb8b65ef3edb43ea9a5575dcddb65beacca Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Wed, 5 Jun 2024 18:22:23 -0500 Subject: [PATCH 1/2] Allow java to consume more memory. --- src/IKVM.Image/IKVM.Image.project.targets | 4 ++-- src/IKVM.Java/IKVM.Java.runtime.targets | 4 ++-- src/javac-ref/javac-ref.csproj | 2 +- src/libosxapp/libosxapp.clangproj | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/IKVM.Image/IKVM.Image.project.targets b/src/IKVM.Image/IKVM.Image.project.targets index 127cee6dc..af686ea62 100644 --- a/src/IKVM.Image/IKVM.Image.project.targets +++ b/src/IKVM.Image/IKVM.Image.project.targets @@ -21,7 +21,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java.exe')) - -Xmx1536M + "$(JavaPath)" $(JavaArgs) @@ -33,7 +33,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac.exe')) - -J-Xmx1536M + "$(JavaCompilerPath)" $(JavaCompilerArgs) diff --git a/src/IKVM.Java/IKVM.Java.runtime.targets b/src/IKVM.Java/IKVM.Java.runtime.targets index 168fa916b..c0c670c7b 100644 --- a/src/IKVM.Java/IKVM.Java.runtime.targets +++ b/src/IKVM.Java/IKVM.Java.runtime.targets @@ -20,7 +20,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java.exe')) - -Xmx1536M + "$(JavaPath)" $(JavaArgs) @@ -32,7 +32,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac.exe')) - -J-Xmx1536M + "$(JavaCompilerPath)" $(JavaCompilerArgs) diff --git a/src/javac-ref/javac-ref.csproj b/src/javac-ref/javac-ref.csproj index 261255fa4..4b232be5d 100644 --- a/src/javac-ref/javac-ref.csproj +++ b/src/javac-ref/javac-ref.csproj @@ -30,7 +30,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac.exe')) - -J-Xmx1536M + "$(JavaCompilerPath)" $(JavaCompilerArgs) diff --git a/src/libosxapp/libosxapp.clangproj b/src/libosxapp/libosxapp.clangproj index 51a375c9e..9241d4e5c 100644 --- a/src/libosxapp/libosxapp.clangproj +++ b/src/libosxapp/libosxapp.clangproj @@ -37,7 +37,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\java.exe')) - -Xmx1536M + "$(JavaPath)" $(JavaArgs) @@ -48,7 +48,7 @@ $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac')) $([System.IO.Path]::GetFullPath('$(JAVA_HOME)\bin\javac.exe')) - -J-Xmx1536M + "$(JavaCompilerPath)" $(JavaCompilerArgs) From 84c765fc25c130e7c7c274f8f4121f73dc009808 Mon Sep 17 00:00:00 2001 From: Jerome Haltom Date: Thu, 6 Jun 2024 12:24:07 -0500 Subject: [PATCH 2/2] Add a module initializer to IKVM.Java, which should preempt any access to static ctors. --- src/IKVM.Java/local/ikvm/runtime/Startup.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/IKVM.Java/local/ikvm/runtime/Startup.java b/src/IKVM.Java/local/ikvm/runtime/Startup.java index c035c0a28..be8832939 100644 --- a/src/IKVM.Java/local/ikvm/runtime/Startup.java +++ b/src/IKVM.Java/local/ikvm/runtime/Startup.java @@ -8,6 +8,11 @@ private Startup() } + @ikvm.lang.ModuleInitializer + public static void init() { + cli.System.GC.KeepAlive(cli.IKVM.Runtime.JVM.class); + }; + /** * Ensures the given assembly is added to the boot class path of the running JVM instance. */