How to change java.io.tmpdir in system properties

Avatar

Avatar

chung_yonge1684

Avatar

chung_yonge1684

chung_yonge1684

30-11-2018

Hello Everypne,

In order to change the java.io.tmpdir to 'C:\Adobe\AEM\Author\cq-temp', I changed like the below that  in C:\Adobe\AEM\Author\crx-quickstart\bin\start.bat

::* -------------------

::* Default JVM options

::* -------------------

set CQ_JVM_OPTS=-server

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Djava.awt.headless=true

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Xms8192m

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Xmx8192m

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:MaxMetaspaceSize=512m

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:NewRatio=1

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:MaxTenuringThreshold=15

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+UseConcMarkSweepGC

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:ConcGCThreads=4

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:ParallelGCThreads=4

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Djava.io.tmpdir=C:\Adobe\AEM\Author\cq-temp

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+HeapDumpOnOutOfMemoryError

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:HeapDumpPath=C:\Adobe\AEM\Author\cq-temp

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Doak.queryLimitInMemory=500000

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Doak.queryLimitReads=100000

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dupdate.limit=250000

set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Doak.fastQuerySize=true

But it doesn't  change.

1634474_pastedImage_1.png

My environment is the following :

-AEM 6.3

-Windows 10

-Java 1.8.1

Can you help me with mine?

Regards

Chung Yong.

Replies

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

03-12-2018

that would be a good way to start. 8 GB of Ram is not a lot of RAM for an enterprise server. However 8 is within specification of AEM Technical Requirements

Highlighted

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

03-12-2018

Adding more RAM to the machine itself does not solve the problem in the first place, you need to give the JVM more heap. In my local development environments I always used -Xmx1G and it worked flawlessly.

What kind of package do you install?

Jörg

Highlighted

Avatar

Avatar

chung_yonge1684

Avatar

chung_yonge1684

chung_yonge1684

04-12-2018

This is my CQ_JVM_OPTS.

CQ_JVM_OPTS='-server -Xms4096m -Xmx4096m  -Xss1024k  -XX:MaxPermSize=512m  -XX:-UseGCOverheadLimit -Djava.awt.headless=true -Djava.io.tmpdir=C:\Adobe\AEM\Author\cq-temp'

When I upload cotent2.zip(723 MB) into Package Manager,  GC overhead limit exceeded happens.

This is my system.

1638808_pastedImage_0.png

This is my Task Manager.

1638823_pastedImage_0.png

1638836_pastedImage_1.png

Highlighted

Avatar

Avatar

WASIL

Employee

Avatar

WASIL

Employee

WASIL
Employee

04-12-2018

In case if you are not starting the instance using <crx-quickstart>\bin\start.bat,  please do. It seems you are starting by double-clicking on the jar file.

Thanks

Wasil

Highlighted

Avatar

Avatar

chung_yonge1684

Avatar

chung_yonge1684

chung_yonge1684

04-12-2018

Yes, I was starting by double-clicking on the jar file.

Can you explain how to run start.bat in command.

I referenced the following url.

Command Line Start and Stop

But I can not run start.bat

1638912_pastedImage_1.png

Highlighted

Avatar

Avatar

WASIL

Employee

Avatar

WASIL

Employee

WASIL
Employee

04-12-2018

In Windows explorer, just execute the start.bat by double clicking it. I assume java is set on the path environment variable already[1].

It would launch the AEM instance in new CMD shell as follows :

1638909_pastedImage_1.png

Thanks

Wasil

[1] How to set JAVA_HOME on Windows 10? – Mkyong.com

P.S. : Stop existing running AEM instance to avoid any port conflict while startup.

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

04-12-2018

Our Cust Care team suggested:

There is a powershell script they can run on their windows environment to capture thread dumps and windows process information (similar to top)

https://github.com/cqsupport/jstackSeries.sh/blob/master/jstackSeries_powershell.ps1

CPU utilization would be high here as GC would be throttling the instance

That -xss JVM flag seems … out of place.  It limits the thread stack to 1 MB which is tiny .

That MaxPermSize flag is also useless if they are on Java8.

Highlighted

Avatar

Avatar

chung_yonge1684

Avatar

chung_yonge1684

chung_yonge1684

04-12-2018

I have already added JAVA_HOME in Environment Varialble for System.

But I can not start start.bat in Windows PowerShell too.

1638928_pastedImage_0.png

This is my start.bat

@echo off

:: This script configures the start information for this server.

::

:: The following variables may be used to override the defaults.

:: For one-time overrides the variable can be set as part of the command-line; e.g.,

::

::     SET CQ_PORT=1234 & ./start.bat

::

setlocal

::* TCP port used for stop and status scripts

if not defined CQ_PORT set CQ_PORT=4502

::* hostname of the interface that this server should listen to

:: if not defined CQ_HOST set CQ_HOST=

::* runmode(s)

::* will not be used if repository is already present

if not defined CQ_RUNMODE set CQ_RUNMODE=author

::* name of the jarfile

:: if not defined CQ_JARFILE set CQ_JARFILE=

::* default JVM options

if not defined CQ_JVM_OPTS set CQ_JVM_OPTS='-server -Xms8192m -Xmx8192m -Xss1024k -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit -Djava.awt.headless=true -Djava.io.tmpdir=C:\Adobe\AEM\Author\cq-temp'

::* ------------------------------------------------------------------------------

::* authentication

::* ------------------------------------------------------------------------------

::* when using oak (crx3) authentication must be configured using the

::* Apache Felix JAAS Configuration Factory service via the Web Console

::* see http://jackrabbit.apache.org/oak/docs/security/authentication/externalloginmodule.html

::* use jaas.config (legacy: only used for crx2 persistence)

:: if not defined CQ_USE_JAAS set CQ_USE_JAAS=true

::* config for jaas (legacy: only used for crx2 persistence)

if not defined CQ_JAAS_CONFIG set CQ_JAAS_CONFIG=etc\jaas.config

::* ------------------------------------------------------------------------------

::* persistence mode

::* ------------------------------------------------------------------------------

::* the persistence mode can not be switched for an existing repository

set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3tar

:: set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3mongo

::* settings for mongo db

:: if not defined CQ_MONGO_HOST set CQ_MONGO_HOST=127.0.0.1

:: if not defined CQ_MONGO_PORT set CQ_MONGO_PORT=27017

:: if not defined CQ_MONGO_DB   set CQ_MONGO_DB=aem6

::* ------------------------------------------------------------------------------

::* do not configure below this point

::* ------------------------------------------------------------------------------

chdir /D %~dp0

cd ..

if exist conf\controlport del conf\controlport

if not defined CQ_JARFILE     for %%X in (app\*.jar) do set CQ_JARFILE=%%X

for %%* in (.) do set CurrDirName=%%~n*

cd ..

set START_OPTS=start -c %CurrDirName% -i launchpad

if defined CQ_PORT            set START_OPTS=%START_OPTS% -p %CQ_PORT%

if defined CQ_RUNMODE         set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dsling.run.modes=%CQ_RUNMODE%

if defined CQ_HOST            set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dorg.apache.felix.http.host=%CQ_HOST%

if defined CQ_HOST            set START_OPTS=%START_OPTS% -a %CQ_HOST%

if defined CQ_MONGO_HOST      set START_OPTS=%START_OPTS% -Doak.mongo.host=%CQ_MONGO_HOST%

if defined CQ_MONGO_PORT      set START_OPTS=%START_OPTS% -Doak.mongo.port=%CQ_MONGO_PORT%

if defined CQ_MONGO_DB        set START_OPTS=%START_OPTS% -Doak.mongo.db=%CQ_MONGO_DB%

if defined CQ_USE_JAAS        set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Djava.security.auth.login.config=%CQ_JAAS_CONFIG%

set START_OPTS=%START_OPTS% -Dsling.properties=conf/sling.properties

if exist newTaskList.txt del newTaskList.txt

if exist oldTaskList.txt del oldTaskList.txt

tasklist /FI "IMAGENAME eq java.exe" /NH > oldTaskList.txt

start "CQ" cmd.exe /C java %CQ_JVM_OPTS% -jar %CurrDirName%\%CQ_JARFILE% %START_OPTS%

:: removing the delay until CQ-4202186 is solved

:: timeout /T 1 /NOBREAK >nul

tasklist /FI "IMAGENAME eq java.exe" /NH > newTaskList.txt

java -cp %~dp0 GetProcessID oldTaskList.txt newTaskList.txt java.exe > %CurrDirName%\conf\cq.pid

if exist newTaskList.txt del newTaskList.txt

if exist oldTaskList.txt del oldTaskList.txt

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

04-12-2018

You could be facing a bug of some sort. Customer care and AEM community members have attempted to answer this. If you are still facing issues, i recommend opening a support ticket so our cust care team can investigate this and get to the bottom of what is happening.

Highlighted

Avatar

Avatar

chung_yonge1684

Avatar

chung_yonge1684

chung_yonge1684

05-12-2018

I fixed the error.

CQ_JVM_OPTS In start.bat changed like the below that.

if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xms8192m -Xmx8192m -Xss1024k -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit -Djava.awt.headless=true -Djava.io.tmpdir=C:\Adobe\AEM\Author\cq-temp

Thank you.