On our shared server, users are limited to 25 processes. A login script further reduces the soft limit by another 5 processes. This safety margin allows the user to log in an kill something which is using up all their processes. If they want they can raise their soft limit back up to the hard limit.
This works well for most things but java insists on using lots of processes. Confusingly, it prints this message:
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# An error report file with more information is saved as:
The log file is not of much use. It repeats the claim about 'insufficient memory' which is not true and none of the listed solutions will help.
The problem is that the default garbage collector (GC) scales up with the number of CPU cores. Our old server had 8 but the new server has 24. This is easily pushing the users over the 20 thread soft limit.
I don't if the log file lists the number of java threads. If it does I can't work out how to read it. If it could be found it could be compared with the number of available processes:
expr $(ulimit -u) - $(ps x | wc --lines)
In the past I used to solve this problem by adding this to the login script:
alias java="java -client"
but that does not work any more. I don't know when it was removed but it leaves me with the headache of finding a new workaround.
After some research I found this page https://wiki.csiro.au/pages/viewpage.action?pageId=545034311 which suggested using
or even just
This seems to solve the immediate problem but still is not all that useful. To specify the flag to run java you need this syntax:
but for javac you have to specify like this:
and I don't expect anyone should have to remember that. One simple solution is to alias both those commands but there are many other tools which are part of java which would also need aliases. These other tools may (and do) use their own unique command line parameters which I would rather not have to learn.
Luckily there is also an environment variable you can set like this:
export _JAVA_OPTIONS="-XX:ParallelGCThreads=1 -XX:+UseParallelGC"
however, that makes all the java programs print out this annoying message:
Picked up _JAVA_OPTIONS: -XX:ParallelGCThreads=1 -XX:+UseParallelGC
And the word on the internet is that there is no way to suppress that message.
My solution to use an alias for the most common tools java and javac while keeping the environment variable for all other programs. At first I tried to use this in my alias:
_JAVA_OPTIONS= /usr/bin/java -XX:+UseSerialGC
but an empty variable still shows the message (and best I can tell, bash won't unset a variable like that). I needed to unset it so I had to combine the env command like this:
env -u _JAVA_OPTIONS -XX:+UseSerialGC
My final profile script looks like this:
export _JAVA_OPTIONS="-XX:ParallelGCThreads=1 -XX:+UseParallelGC"
alias java="env -u _JAVA_OPTIONS $(which --skip-alias java) $_JAVA_OPTIONS"
alias javac="env -u _JAVA_OPTIONS $(which --skip-alias javac)$(for i in $_JAVA_OPTIONS ; do echo -n " -J$i" ; done)"
You can select which GC you want. I have demonstrated with the more complex example which has two options to be prefixed for javac.
The java users can now happily compile away without java needing the entire machine resources for every invocation.
This news is crucial for all of us. TawnyReplyDelete
Oracle says that it's discontinuing its Java browser plugin starting with the next big release of the programming languageReplyDelete
Your discussion about the usage limit is enough to say that this is the because in server limit about 25 may be enough other than you can add 5 more users in it.ReplyDelete
i love your blog, share more content Samsung firmwareReplyDelete
After everything is polished to a sheen, your find out here project is then uploaded to your customer account. All proofreading and editing services done by this department are not billed.ReplyDelete
Mail order brides websites are gaining popularity nowadays, and many men from different continents use them to thai brides find beautiful brides and wives who will become their loyal friend and loving partner for life.ReplyDelete
Aw, this was a really nice post. In idea I would like to put in writing like this additionally – taking time and actual effort to make a very good article… but what can I say… I procrastinate alot and by no means seem to get something done.ReplyDelete
professional excavation company
If you want to bring more business and more engaging customers to your brand, it is essential to have website development services. People in US tend to shop online, as social media provides easy and safe access to everybody worldwide. Since the growth of the international market has increased many folds, a website has become a necessity of every business.ReplyDelete
Such a beneficial and informational post it is. Moreover, in this era of rapid digitization and modernization in USA, ecommerce website has become a need of every business. If you want to open a door of infinite opportunities from all over the world, then getting yourself an ecommerce website is the best option.ReplyDelete
كيفيّة القضاء على السوس استخدام ورق الغار يمكن التخلّص من السوس، خاصةً السوس الموجود في الطحين من خلال استخدام ورق الغار الأخضر، حيث يمكن وضع ورقة واحدة منه في علب الطحين، أو أكياس الطحين المخزّنة، إذ تساعد هذه الأوراق الطبيعيّة على منع دخول السوس، وذلك وفقاً لاعتقادات بعض الناس، ولكن يُراعى استبدال هذه الأوراق كلّ بضعة أشهر، أو عند زوال رائحتها.ReplyDelete
شركة مكافحة حشرات بخميس مشيط
شركة مكافحة حشرات بتبوك
شركة مكافحة حشرات بالخبر
We have on board domain experts who are PhD holders from renowned universities across the globe, and we exclusively offer top notch Law Assignment Help Our experts have tremendous experience in furnishing excellent quality Business Law Assignment Help within the shortest of deadlines. Our Tort Law Assignment Help consistently furnish bespoke and non-plagiarized work that fetch excellent grades too. You save a ton of time to prepare well for your term-end exams by seeking the amazingly affordable Commercial Law Assignment Help.ReplyDelete
I recommend you to try this ThesisLeader. They provide expert excel help in the USA.ReplyDelete
In our company write my essay performers are registered, among which there are those who offer to write any term paper to order. On our website from specialists you can buy inexpensive term paper in any of the disciplines and do not even doubt that you will be satisfied with the resultReplyDelete
It's really good to build up information knowledge. My hobby is web surfing. If I have a chance, I will visit you again. The website is really cool. But its necessary to click the link belowReplyDelete
I was able to think a lot while looking at this post.ReplyDelete
I will pass this blog to many people. Definitely a good blog is very good. Thank you for sharing.
To get started with norton antivirus, you need to visit Norton.com/setup and enter the norton product key. Norton setup prduct key is a 25 digit activation code.ReplyDelete
Download the Canon printer from ij.start.canon and set it up on your device. Canon printers are all in one printer that facilitates print, copy and scan.ReplyDelete
Login to your turbotax.ca/download account. Access your order history and TurboTax desktop software downloads, unlocks, and tax documents.Plug in the machine and power it on. Connect the machine to your computer with the USB cord or pair it via Bluetooth.ReplyDelete
Enter Office Product Key to Setup microsoft office 365 or office setup 2019 at office.com/setup. Steps to get office setup product key.ReplyDelete