What is the significance of '-client' for JAVA_OPTS - client

I am not an expert on JAVA_OPTS, but I am getting an error in my grails app related to Permgen space. Now I receive a recommendation from grails blog to set JAVA_OPTS to this value:
JAVA_OPTS="-client -Xmx256M $JAVA_OPTS"
I do understand the other values except '-client'. What does it really mean? I can't find the significance of it in books.

The -client and -server options are intended to optimize performance for client and server applications; the default varies by platform, where typically client-oriented platforms (Windows, MacOS) get the client VM by default, and typically server-oriented platforms (Linux, Windows Server) get the server VM by default. More information is available here: http://download.oracle.com/javase/6/docs/technotes/guides/vm/index.html
Basically, the client VM is optimized to start up quickly and use less memory, while the server VM is designed for maximum performance after start-up.

Usually, there is -server and -client,
-client starts faster than -server.
Nowadays, in some versions, like AMD64 version, it does nothing, there is only server version.

Related

How to limit GeoServer memory usage?

How can I limit the memory usage of GeoServer (v.2.21.1) installed on a Windows Server 2019?
I can't find any setting in the interface to set a limit.
In the same way as any other Java program by setting a JVM option -Xmx756M for example. See the GeoServer manual for recommended best practices

Not able to start Elastic Search in Linux VM

I am trying to install elastic search in Linux VM but could not able to start the service though it has java installed. I am getting following message while elasticsearch script runs.
[xxxx#ABCWCW0ASMGNJ01A bin]$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (novell-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
[xxxx#ABCWCW0ASMGNJ01A bin]$ ./elasticsearch
Error occurred during initialization of VM
Too small initial heap for new size specified
I have downlaoded 2.3.2 from elastic search website. After initial google I did set the ES_HEAP_SIZE=1g in bash_profile but still no luck. Can you thow some light what could be issue.
Thanks
It seems you don't have enough heap space to start elastic. Please go to increase the java heap size permanently? and do the needful.
Depending on the flavor of Linux you are using, you may need to use a text editor to update the following file to increase the heap size.
/etc/sysconfig/elasticsearch
(uncomment the line 'ES_HEAP_SIZE=' and set this to half of the allocated virtual RAM for the VM)--Based on: https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html
I will caution you to read this as well afterwards if you see something like "Unable to lock JVM memory" in your elasticsearch application log after starting it up:
https://github.com/elastic/elasticsearch/issues/9357
I ran into problems myself with trying to use the environment variable method on Centos 6 and 7.
You may also want to try using the Kopf plugin (open source) to get some simple visibility:
https://github.com/lmenezes/elasticsearch-kopf
Using the following general instructions of course:
https://www.elastic.co/guide/en/elasticsearch/plugins/current/installation.html
If you don't know where certain things are located for elasticsearch on your system, please use the below defaults listing as guidance:
https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-dir-layout.html
The root cause of the problem you are experiencing is most likely related to the startup script being used to bring up your instance of elasticsearch on the VM and it not utilizing the environment variable as expected. I hope you don't mind the extra information, I'm just trying to help you save some time.

Running Redis on Windows as service

I have followed all the suggestions I can find.
I am running the current version on redis on windows 2008
I can run fin from command line
I can install the service but it doesnt run
I do...
redis-server --service-install redis.windows.conf
and get "redis successfully installed as a service"
Then I try to start the service doing...
redis-server --service-start redis.windows.conf --loglevel verbose
and get Redis service failed to start
I have made sure I have the .net framework 4.5.2 installed, I have tried with the firewall off and have played with security on the folder.
Anyone have any ideas?
(Merry Christmas all)
Start redis server from the command line instead of as a service and it will display a more useful error message. If you are just using the default configuration it is most likely a problem with the maxmemory/maxheap configuration.
C:\redis>redis-server.exe redis.windows.conf
[1576] 04 Feb 10:32:54.172 #
The Windows version of Redis allocates a memory mapped heap for sharing with
the forked process used for persistence operations. In order to share this
memory, Windows allocates from the system paging file a portion equal to the
size of the Redis heap. At this time there is insufficient contiguous free
space available in the system paging file for this operation (Windows error
0x5AF). To work around this you may either increase the size of the system
paging file, or decrease the size of the Redis heap with the --maxheap flag.
Sometimes a reboot will defragment the system paging file sufficiently for
this operation to complete successfully.
Please see the documentation included with the binary distributions for more
details on the --maxheap flag.
Redis can not continue. Exiting.
In my case the default commandline config did not have logging enabled and the service one did. And no place where it complains about that.
Try creating the directory ./Logs.
Old question, but I came across it while trying to get a Win7x64 install working using binaries Redis-x64-2.8.2101. Couldn't get it to start despite fiddling with various options, no meaningful error given when run with the config, and only an apparently spurious disk space error when run natively.
There appears to be a issue on the github related, linked here for future benefit: https://github.com/MSOpenTech/redis/issues/267

NetBeans goes very slow

I'm using NetBeans IDE 6.9.1. I have a web application in JSP using Spring version 3.0.2 and Hibernate Tools 3.2.1.GA. Slowly and gradually, it has been growing in size yet it's not a very big application though I have added many external class libraries as and when required like HibernateValidator.
The performance is degraded and it takes a considerable amount of time in building the application. When changes are saved, many a times, the application is deployed infinitely/endlessly with the auto-deploy feature of NetBeans. It never ends and I have to restart the IDE and the procedure begins all over again from scratch. Sometimes the application is stopped automatically and I have to restart the Tomcat server (6.0.26) because mostly an attempt to restart the application doesn't succeed.
Many a times (every half an hour or so), the application ends with following exception.
java.lang.OutOfMemoryError: PermGen Space
and I have to restart the system itself!
While working with JPA along with EJB and JSF as a front-end (GlassFish Server 3), it often wasn't the case even with heavily loaded applications with the same version of the NetBeans IDE and exactly the same platform, if I remember correctly.
Are there some ways to improve the performance?
try overriding the jvm option for more memory if you can
export JAVA_OPTS="-Xms64m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=756m"
here http://www.unidata.ucar.edu/projects/THREDDS/tech/tds4.2/reference/JavaOptsSummary.html you can find a bit more about java_opts parameters
I understand you are using Netbeans. A simple solution would be to go tools->servers -> (selecte the server (in your case tomcat))->platform, then in the VM option, paste this settings:
-Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m
that would solve your problem. good luck!

Significant Performance Decrease when moving from Windows Server 2003 to 2008 (IIS 6 to IIS 7)

Our ASP.Net 2.0 web app was running happily along on Windows Server 2003. We were starting to see some of the limits of the environment approaching, such as memory and CPU usage spikes, and as we're getting ready to scale we decided it was time for a larger server with higher availability.
We decided to move to Windows Server 2008 to take advantage of IIS 7's shared configuration. In our development and integration environments, we reproduced the OS and app in 2008/IIS 7 and everything seemed fine. But truth be told, don't have a good way of simulating production-like loads as of yet, nor can we reproduce our prod environment accurately (we're small with limited resources). So once we rolled out to production, we were surprised to find performance significantly worse on 2008 than it was on 2003.
We've also moved from a 32-bit environment to 64-bit in the process, and we've also incorporated ASP.Net 3.5 dll's into the project.
Memory usage is through the roof, but I'm not as worried about that. We believe in part this is because of the overhead with Server 2008's memory, so throwing more RAM at it may solve that issue. The troubling thing is we're seeing processor spikes to 99% CPU Utilization, which we've never seen before in the 2003/IIS 6 environment.
Has anyone encountered these issues before and are there any suggestions for a solution/places to look? Right now we're doing the following:
1) Buying time by adding memory.
2) Buying time by setting app pool limits: shut down w3wp.exe when CPU hits 99% load. Since you don't have the option to recycle the app pools, I have a scheduled task running that recycles any stopped app pools.
3) Profiling the app pools under Classic and Integrated modes to see which may perform better.
Any other ideas are completely welcome.
Our experiance is that code runs much faster on a 64bit windows 2008 than on a 32bit windows 2003 server.
I am wondering if something else is also running on the machine. For example is SQL Server installed with a maintainence plan that could cause the CPU spike.
I would check the following:
Which process is using the CPU?
Is there a change in the code? Try installing the new code on the old machine
Is it something to do with the compile options? Is the CPU usage a recompile?
Are there any errors in the event log?
In our cases, since we have 4 processors, we then increased the "number of worker process to 4" currently working well so far as compare before.
here a snapshot:
http://pic.gd/c3661a
You can use the application pool "Recycle" option in IIS7+ to configure physical and virtual memory limits for application pools. Once these are reached the process will recycle and the resources will be released. Unfortunately the option to recycle based on CUP usage has been removed from IIS7+ (some one correct me if I'm wrong). If you have other apps on the server and want to avoid them competing for resources when this condition happens you can implement Windows System Resources Manager and it's IIS policy (here is a good tutorial http://learn.iis.net/page.aspx/449/using-wsrm-to-manage-iis-70-apppool-cpu-utilization/)
Note SRWM is only available on Enterprise and Data Center editions.

Resources