JaroslavTulach at 12:57, 18 March 2014 - 2014-03-18 12:57:02

←Older revision Revision as of 12:57, 18 March 2014
Line 23: Line 23:
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
-
For a while I was searching for a solution. I tried to pass in '''-mx64M''' into every started process, but as far as I can tell, this is not easy. There does not seem to be any configuration file the ''java'' launcher reads (''jvm.cfg'' is not the one, one cannot specify there default command line arguments).
+
For a while I was searching for a solution. I tried to pass in '''-mx64M''' into every started process, but as far as I can tell, this is not easy. There does not seem to be any configuration file the ''java'' launcher reads (''jvm.cfg'' is not the one, one cannot specify there default command line arguments). Well, it is not documented, but there is:
-
One can specify the parameter on command line, which is not practical. If you don't start the process yourself, how do you influence command line? That is why I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell script to call the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution at all.
+
<source lang="bash">
 +
_JAVA_OPTIONS="-Xmx64M -XX:MaxPermSize=32M"
 +
export _JAVA_OPTIONS
 +
</source>
 +
 
 +
So now, instead of specifying the parameter on command line, which is not practical you can put the above code snippet into ''/etc/profile.d/java.sh'' and all ''java'' processes will pick it up! Hopefully it will work now!
 +
 
 +
=== The Previous Solutions ===
Then a friend of mine suggested to try official [[JDK]], not just [[OpenJDK]] variant. I hesitated for a while, but then I decided to try it. Here is the ''top'' output:
Then a friend of mine suggested to try official [[JDK]], not just [[OpenJDK]] variant. I hesitated for a while, but then I decided to try it. Here is the ''top'' output:

Cordeo: Correct typo (achive => achieve) - 2010-11-29 14:22:18

Correct typo (achive => achieve)

←Older revision Revision as of 14:22, 29 November 2010
Line 1: Line 1:
-
[[wikipedia:Virtualization|Virtualization]] is an important aspect in [[cluelessness]]. Instead of improving own application, or making it more secure, one can run it in an isolated, dedicated virtual computer. It may require more memory or more powerful processors, but the need of software quality is lower and thus one can ''achive more by knowing less'' - the credo of [[cluelessness]].
+
[[wikipedia:Virtualization|Virtualization]] is an important aspect in [[cluelessness]]. Instead of improving own application, or making it more secure, one can run it in an isolated, dedicated virtual computer. It may require more memory or more powerful processors, but the need of software quality is lower and thus one can ''achieve more by knowing less'' - the credo of [[cluelessness]].
== OpenJDK ==
== OpenJDK ==

JaroslavTulach: /* Too Big Initial Limit */ - 2010-06-15 11:06:56

Too Big Initial Limit

←Older revision Revision as of 11:06, 15 June 2010
Line 54: Line 54:
<comments/>
<comments/>
 +
 +
{{:Talk:Virtualization}}

JaroslavTulach: /* Too Big Initial Limit */ - 2010-06-14 15:47:43

Too Big Initial Limit

←Older revision Revision as of 15:47, 14 June 2010
Line 49: Line 49:
The difference between [[OpenJDK]] and [[JDK]] seems to be result of [http://markmail.org/message/siqnosoeifjfxm6t this change]. It increases the heap limit to 512MB and the perm gen size to 128MB claiming that if Eclipse needs it, every other [[Java]] application will need it as well.
The difference between [[OpenJDK]] and [[JDK]] seems to be result of [http://markmail.org/message/siqnosoeifjfxm6t this change]. It increases the heap limit to 512MB and the perm gen size to 128MB claiming that if Eclipse needs it, every other [[Java]] application will need it as well.
-
No it won't. If you run multiple [[VM]]s with for example [[JUnit]] tests in parallel, the performance will suffer.
+
No it won't. If you run multiple [[VM]]s with small applications (for example [[JUnit]] tests) in parallel, the performance will suffer.
-
It would indeed be great if the [[VM]] internal structures could start small and grow, but if that is not possible for some reasons now, then the ''ergonomics'' need to prevent allocating more memory than is physically available. Blindly increasing the default is contra productive.
+
It would indeed be great if the [[VM]] internal structures could start small and grow, but if that is not possible for some reasons now, then the default ''ergonomics'' need to take existing system resources into account. Especially it needs to prevent allocating more memory than is physically available.
<comments/>
<comments/>

JaroslavTulach: /* OpenJDK */ - 2010-06-14 15:46:16

OpenJDK

←Older revision Revision as of 15:46, 14 June 2010
Line 44: Line 44:
Conclusion? [[OpenJDK]] seems to contain a bug in a launcher which makes it completely unsuitable for running in a [[virtualization|virtualized environment]]! What a shame for a standard [[Java]] implementation present in each [[Linux]] distribution!
Conclusion? [[OpenJDK]] seems to contain a bug in a launcher which makes it completely unsuitable for running in a [[virtualization|virtualized environment]]! What a shame for a standard [[Java]] implementation present in each [[Linux]] distribution!
 +
 +
=== Too Big Initial Limit ===
 +
 +
The difference between [[OpenJDK]] and [[JDK]] seems to be result of [http://markmail.org/message/siqnosoeifjfxm6t this change]. It increases the heap limit to 512MB and the perm gen size to 128MB claiming that if Eclipse needs it, every other [[Java]] application will need it as well.
 +
 +
No it won't. If you run multiple [[VM]]s with for example [[JUnit]] tests in parallel, the performance will suffer.
 +
 +
It would indeed be great if the [[VM]] internal structures could start small and grow, but if that is not possible for some reasons now, then the ''ergonomics'' need to prevent allocating more memory than is physically available. Blindly increasing the default is contra productive.
<comments/>
<comments/>

JaroslavTulach: /* OpenJDK */ - 2010-06-14 14:18:40

OpenJDK

←Older revision Revision as of 14:18, 14 June 2010
Line 43: Line 43:
Better. The 240M of occupried space is still much more than I'd like to see (no wonder nobody offers free hosting of Java applications), but at least it fits into real memory. By using [[JDK]] ''1.6.0_20'' I can really run my [[Hudson]] in [[VirtualBox]] with 384M of memory.
Better. The 240M of occupried space is still much more than I'd like to see (no wonder nobody offers free hosting of Java applications), but at least it fits into real memory. By using [[JDK]] ''1.6.0_20'' I can really run my [[Hudson]] in [[VirtualBox]] with 384M of memory.
-
Conclusion? [[OpenJDK]] seems to contain a bug in a launcher which makes it completely unsuitable for running in a [[virtualization|virtualized environment]]!
+
Conclusion? [[OpenJDK]] seems to contain a bug in a launcher which makes it completely unsuitable for running in a [[virtualization|virtualized environment]]! What a shame for a standard [[Java]] implementation present in each [[Linux]] distribution!
<comments/>
<comments/>

JaroslavTulach: /* OpenJDK */ - 2010-06-14 14:17:24

OpenJDK

←Older revision Revision as of 14:17, 14 June 2010
Line 23: Line 23:
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
-
For a while I was searching for a solution. I tried to pass in '''-mx64M''' into every started process, but as far as I can tell, this is not easy. There does not seem to be any configuration file the ''java'' launcher reads (''jvm.cfg'' is not the one, one cannot specify there default command line arguments). It can be done only on command line, which is not practical, if you don't start the process yourself. So I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell that calls the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution.
+
For a while I was searching for a solution. I tried to pass in '''-mx64M''' into every started process, but as far as I can tell, this is not easy. There does not seem to be any configuration file the ''java'' launcher reads (''jvm.cfg'' is not the one, one cannot specify there default command line arguments).
 +
 
 +
One can specify the parameter on command line, which is not practical. If you don't start the process yourself, how do you influence command line? That is why I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell script to call the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution at all.
Then a friend of mine suggested to try official [[JDK]], not just [[OpenJDK]] variant. I hesitated for a while, but then I decided to try it. Here is the ''top'' output:
Then a friend of mine suggested to try official [[JDK]], not just [[OpenJDK]] variant. I hesitated for a while, but then I decided to try it. Here is the ''top'' output:

JaroslavTulach: /* OpenJDK */ - 2010-06-14 14:15:50

OpenJDK

←Older revision Revision as of 14:15, 14 June 2010
Line 23: Line 23:
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
-
For a while I was searching for a solution. I tried to pass in -mx64M into every started process, but as was as I can tell, this is not easy. It can be done only on command line, which is not practical, if you don't start the process yourself. So I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell that calls the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution.
+
For a while I was searching for a solution. I tried to pass in '''-mx64M''' into every started process, but as far as I can tell, this is not easy. There does not seem to be any configuration file the ''java'' launcher reads (''jvm.cfg'' is not the one, one cannot specify there default command line arguments). It can be done only on command line, which is not practical, if you don't start the process yourself. So I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell that calls the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution.
Then a friend of mine suggested to try official [[JDK]], not just [[OpenJDK]] variant. I hesitated for a while, but then I decided to try it. Here is the ''top'' output:
Then a friend of mine suggested to try official [[JDK]], not just [[OpenJDK]] variant. I hesitated for a while, but then I decided to try it. Here is the ''top'' output:

JaroslavTulach: /* OpenJDK */ - 2010-06-14 14:10:42

OpenJDK

←Older revision Revision as of 14:10, 14 June 2010
Line 21: Line 21:
</source>
</source>
-
650MB of virtual space is a lot. If you moreover realize that hudson starts multiple Java VMs in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
+
650MB of virtual space is a lot. If you moreover realize that [[hudson]] starts multiple [[Java]] [[VM]]s in parallel, it is easy to see that the system can't work. Indeed it did not: swap was full all the time, sometimes the [[VirtualBox]] machine rebooted, etc.
For a while I was searching for a solution. I tried to pass in -mx64M into every started process, but as was as I can tell, this is not easy. It can be done only on command line, which is not practical, if you don't start the process yourself. So I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell that calls the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution.
For a while I was searching for a solution. I tried to pass in -mx64M into every started process, but as was as I can tell, this is not easy. It can be done only on command line, which is not practical, if you don't start the process yourself. So I renamed ''java'' to ''java.openjdk'' and replaced ''java'' with a shell that calls the ''java.openjdk'' with proper parameter. This worked, but only for ''java'', not for ''javadoc'', etc. So I was not satisfied with the solution.

JaroslavTulach: /* OpenJDK */ - 2010-06-14 14:10:07

OpenJDK

←Older revision Revision as of 14:10, 14 June 2010
Line 5: Line 5:
I wanted to run this site's associated [http://hudson.apidesign.org hudson builder] in an isolated environment. Originally I was using [[vserver]], but after my hard disk crashed, I decided to try [[VirtualBox]].
I wanted to run this site's associated [http://hudson.apidesign.org hudson builder] in an isolated environment. Originally I was using [[vserver]], but after my hard disk crashed, I decided to try [[VirtualBox]].
-
I am running [[Kubuntu]] as host and also a stripped down version of [[Kubuntu]] as a guest. I have given the guest 384MB of memory and 400MB of swap. To my biggest surprised, running even smallest [[Java]] program on [[OpenJDK]] in such environment allocated 650MB(!!!) of virtual addressing space. Just check the ''top'' output:
+
I am running [[Kubuntu]] as host and also a stripped down version of [[Kubuntu]] as a guest. I have given the guest 384MB of memory and 400MB of swap. To my biggest surprise, running even smallest [[Java]] program on [[OpenJDK]] in such environment allocated 650MB(!!!) of virtual addressing space. Just check the ''top'' output:
<source lang="bash">
<source lang="bash">