Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Created August 26, 2024 07:50
Show Gist options
  • Save ozcanzaferayan/11d78a532a37809e500f50c8a384d5b4 to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/11d78a532a37809e500f50c8a384d5b4 to your computer and use it in GitHub Desktop.
Changes JVM heap size in Expo projects
const { withGradleProperties } = require("expo/config-plugins");
// This plugin sets the JVM heap size to 4GB
module.exports = (config) => {
config = withGradleProperties(config, (config) => {
const projectGradle = config.modResults;
// Find index of org.gradle.jvmargs
const index = projectGradle.findIndex(
(x) => x.key === "org.gradle.jvmargs",
);
// Change value of org.gradle.jvmargs
projectGradle[index] = {
type: "property",
key: "org.gradle.jvmargs",
value: "-Xmx4096m -XX:MaxMetaspaceSize=1024m",
};
config.modResults = projectGradle;
return config;
});
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment