Hi all,
I need to start AEM Author with some JVM parameters using CQ_JVM_OPTS.
Could this be done using Quickstart Jar invocation using Java on command line?
Please share an example.
Appreciate all your replies.
Thanks,
Rama.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Let’s say your AEM Quickstart JAR is at C:\author\aem-author-p4502.jar
.
Here’s how to do it correctly in Windows:
cd C:\author
set CQ_JVM_OPTS=-Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author
This sets the
CQ_JVM_OPTS
variable only for the current Command Prompt session.
java %CQ_JVM_OPTS% -jar aem-author-p4502.jar
Hi @nsvsrk,
Here's how you can do it step by step:
Make sure your AEM Quickstart JAR file (e.g., aem-author-p4502.jar
) is in a clean directory. This JAR file will unpack and create the crx-quickstart
folder when first run.
You can set JVM parameters like heap size, garbage collector type, or system properties like run modes. These are passed using the CQ_JVM_OPTS
environment variable.
Example:
CQ_JVM_OPTS="-Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author"
Use the following command to start AEM, passing in the JVM parameters via CQ_JVM_OPTS
:
java $CQ_JVM_OPTS -jar aem-author-p4502.jar
Alternatively, if you want to make things cleaner (especially in scripts), you can export the variable like this:
export CQ_JVM_OPTS="-Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author"
java $CQ_JVM_OPTS -jar aem-author-p4502.jar
Here are a few useful ones you might consider:
-Xmx4096m
– Set the maximum heap size (4GB in this case)
-Xms2048m
– Set the initial heap size
-XX:+UseG1GC
– Use the G1 garbage collector
-Dsling.run.modes=author
– Run the instance in Author mode
-Dorg.osgi.framework.bootdelegation=sun.*,com.sun.*
– Sometimes used for classloading tweaks
export CQ_JVM_OPTS="-Xms2048m -Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author"
java $CQ_JVM_OPTS -jar aem-author-p4502.jar
That’s it! Your AEM Author instance should now start with the custom JVM parameters you’ve defined.
Thanks Santosh.
Is the "Step 2: Set Your Desired JVM Parameters" executed in command line?
Let us say c:\author has aem-author-p4502.jar.
I could execute CQ_JVM_OPTS="-Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author" on command line like below?
c:\author>CQ_JVM_OPTS="-Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author"
Of course I will execute "Step 3: Start the AEM Instance" on command line only like below:
c:\author>java $CQ_JVM_OPTS -jar aem-author-p4502.jar
Thanks,
RK.
Views
Replies
Total Likes
Let’s say your AEM Quickstart JAR is at C:\author\aem-author-p4502.jar
.
Here’s how to do it correctly in Windows:
cd C:\author
set CQ_JVM_OPTS=-Xmx4096m -XX:+UseG1GC -Dsling.run.modes=author
This sets the
CQ_JVM_OPTS
variable only for the current Command Prompt session.
java %CQ_JVM_OPTS% -jar aem-author-p4502.jar