My Java app on Mac OS needs to process a file that is 2 gigabytes in size.
I already increased the maximum Heap size of Android Studio to 7000MB, by setting
-Xmx7000m
in the file studio.vmoptions
, located in
/Users/[userName]/Library/Application Support/Google/AndroidStudio2024.2
But during the program execution, only 4.2GB are being used by the java process, and
java.lang.OutOfMemoryError: Java heap space
error occurs.
How can this be fixed?
My Java app on Mac OS needs to process a file that is 2 gigabytes in size.
I already increased the maximum Heap size of Android Studio to 7000MB, by setting
-Xmx7000m
in the file studio.vmoptions
, located in
/Users/[userName]/Library/Application Support/Google/AndroidStudio2024.2
But during the program execution, only 4.2GB are being used by the java process, and
java.lang.OutOfMemoryError: Java heap space
error occurs.
How can this be fixed?
Share Improve this question asked yesterday A.G.A.G. 2,1195 gold badges31 silver badges40 bronze badges 1- 1 Are you sure you need to load the entire file into program memory all at once? What type of file is it? – VGR Commented yesterday
1 Answer
Reset to default 0You can change the app's heap space by changing the launch configuration. You can add in the VM options
the -Xmx7000m
.
The change you did before in the studio.vmoptions
is for the IDE itself.