Java issues with Windows Server 2016

Questions and answers for all installation-related topics for Servoy products

Re: Java issues with Windows Server 2016

Postby patrick » Sun Mar 26, 2017 4:45 pm

Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3598
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Java issues with Windows Server 2016

Postby Westy » Sun Mar 26, 2017 8:09 pm

I re-installed Servoy 6.x yet again and now the service starts with no errors. Thank you for the information and the link. Now I will read about managing memory.

Dean
Westy
 
Posts: 833
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Re: Java issues with Windows Server 2016

Postby Westy » Sun Mar 26, 2017 8:48 pm

I have read the memory instructions at the above link. Our solution is webclient only. In the wrapper.conf file (from this latest Servoy 6.x install) the default references to memory are:
'# Java Additional Parameters
wrapper.java.additional.1=-Djava.awt.headless=true
wrapper.java.additional.2=-Duser.dir="C:\Servoy\application_server"
wrapper.java.additional.3=-Djava.io.tmpdir="C:\Servoy\application_server\server\work"
wrapper.java.additional.4=-XX:MaxPermSize=128m

# Working dir (for JNI calls)
wrapper.working.dir=C:\Servoy\application_server

# Initial Java Heap Size (in MB)
wrapper.java.initmemory=32

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1280"

The memory instructions from the link say to specify memory for Java 8 using the syntax:
-server -Xms4G -Xmx4G -XX:+UseG1GC -XX:MetaspaceSize=200M -XX:MaxMetaspaceSize=200M -XX:MinMetaspaceFreeRatio=0 -XX:MaxMetaspaceFreeRatio=100

How exactly do I change the existing wrapper.conf syntax above to the new syntax required for Java 8, for my solution which has in the past required wrapper.java.maxmemory=6400?

Dean
Westy
 
Posts: 833
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Re: Java issues with Windows Server 2016

Postby patrick » Sun Mar 26, 2017 9:10 pm

Continue reading :-). A bit further down in the article is a section on wrapper.conf
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3598
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Java issues with Windows Server 2016

Postby Westy » Sun Mar 26, 2017 9:57 pm

After re-reading the article, I have changed the above section of the wrapper.conf file to:
"# Java Additional Parameters
wrapper.java.additional.1=-Djava.awt.headless=true
wrapper.java.additional.2=-Duser.dir="C:\Servoy\application_server"
wrapper.java.additional.3=-Djava.io.tmpdir="C:\Servoy\application_server\server\work"
wrapper.java.additional.4=-XX:MaxPermSize=128m
wrapper.java.additional.5=-XX:MetaspaceSize=640M
wrapper.java.additional.6=-XX:MaxMetaspaceSize=640M
wrapper.java.additional.7=-XX:MinMetaspaceFreeRatio=0
wrapper.java.additional.8=-XX:MaxMetaspaceFreeRatio=100
wrapper.java.additional.9=-XX:MaxPermSize=128m
wrapper.java.additional.10=-XX:+UseG1GC

# Working dir (for JNI calls)
wrapper.working.dir=C:\Servoy\application_server

# Initial Java Heap Size (in MB), when G1GC is used just set the init memory to the max memory
wrapper.java.initmemory=6400

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=6400"

At the top of the servoy-admin home page it now says
on the production server (Windows Server 2008):
Heap Space Memory: allocated=516608K, used=377391K, max=5825536K
Non-Heap Space Memory: allocated=109824K, used=81228K, max=180224K
on this new staging server (Windows Server 2016):
Heap Space Memory: allocated=6553600K, used=149504K, max=6553600K
Non-Heap Space Memory: allocated=69632K, used=66632K, max=1949696K

Both servers have 12GB of RAM. My objective is to replace the production server with the staging server? If anyone sees anything above that might cause a problem, please let me know.

Dean
Westy
 
Posts: 833
Joined: Fri Feb 13, 2004 5:27 am
Location: Lynnfield, Massachusetts USA

Re: Java issues with Windows Server 2016

Postby jcompagner » Tue Mar 28, 2017 10:17 am

that should be fine except that 640M for the metaspace is quite a lot

if you are using java8 then you only need to have this:

wrapper.java.additional.1=-Djava.awt.headless=true
wrapper.java.additional.2=-Duser.dir="C:\Servoy\application_server"
wrapper.java.additional.3=-Djava.io.tmpdir="C:\Servoy\application_server\server\work"
wrapper.java.additional.4=-XX:MetaspaceSize=200M
wrapper.java.additional.5=-XX:MaxMetaspaceSize=200M
wrapper.java.additional.6=-XX:MinMetaspaceFreeRatio=0
wrapper.java.additional.7=-XX:MaxMetaspaceFreeRatio=100
wrapper.java.additional.8=-XX:+UseG1GC
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7974
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Java issues with Windows Server 2016

Postby goldcougar » Wed Mar 29, 2017 3:56 am

I would also suggest not using hard coded memory values, and instead using the percent values. Servoy should really change their default install to use this. In the modern cloud era, with memory easily scalable up and down, you don't have to have to change your config each time you adjust memory.

Code: Select all
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=32

# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=1280


And instead use these. Adjust those based on your usage (if its a dedicated Servoy server, these may be ok, but if you run the DB server on the same box, you'll want to adjust the max memory down)

Code: Select all
# Initial Java Heap Size (in %  of physical memory available on the system)
wrapper.java.initmemory.percent=10

# Maximum Java Heap Size (in %  of physical memory available on the system)
wrapper.java.maxmemory.percent=70
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Free Training Videos
Servoy Guy- Free Plugins, Tips & Resources
ServoyForge- Open Source Servoy Components
User avatar
goldcougar
Servoy Expert
 
Posts: 657
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Previous

Return to Installation

Who is online

Users browsing this forum: No registered users and 4 guests