<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Java Tuning &#187; Uncategorized</title>
	<atom:link href="http://www.javatuning.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javatuning.com</link>
	<description>Software Development, Java, and some more.</description>
	<lastBuildDate>Tue, 29 Jun 2010 10:29:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>&#8220;Hypervisor edition&#8221; &#8211; what&#8217;s that?</title>
		<link>http://www.javatuning.com/hypervisor-edition-whats-that/</link>
		<comments>http://www.javatuning.com/hypervisor-edition-whats-that/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 19:50:04 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[a glimpse into the future]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[OVF]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[Websphere]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=251</guid>
		<description><![CDATA[WebSphere have announced  WAS hypervisor edition. You get an OVF package with a ready to use WAS profile running on Linux. The OVF package can be deployed on VMWare ESX/ESXi and IBM&#8217;s cludeburst appliance. Websphere also say that they carried out WAS best-practice tuning for the OS. Not sure how mattering this tuning is considering [...]]]></description>
			<content:encoded><![CDATA[<p>WebSphere have announced  <a href="http://www-01.ibm.com/software/webservers/appserv/hypervisor/features/?S_CMP=rnav" target="_blank">WAS hypervisor edition</a>.</p>
<p>You get an <a href="http://en.wikipedia.org/wiki/Open_Virtualization_Format">OVF</a> package with a ready to use WAS profile running on Linux. The OVF package can be deployed on VMWare ESX/ESXi and IBM&#8217;s <a href="http://www-01.ibm.com/software/webservers/cloudburst/">cludeburst</a> appliance.<br />
Websphere also say that they carried out WAS best-practice tuning for the OS. Not sure how mattering this tuning is considering the generic nature of WAS (different application=different tuning), and the generic drivers that a VM uses.</p>
<div id="attachment_252" class="wp-caption alignnone" style="width: 220px"><a href="http://www.javatuning.com/wp-content/uploads/2010/04/installing.jpg"><img class="size-full wp-image-252 " title="Joys of installation" src="http://www.javatuning.com/wp-content/uploads/2010/04/installing.jpg" alt="" width="210" height="210" /></a><p class="wp-caption-text">Joys of installation</p></div>
<p>I wonder how enterprise IT administrators would accept an OS different  from what they usually roll with.</p>
<p>important to mention that similar zero-install pre-configured WAS  environment are available on the <a href="http://www-180.ibm.com/cloud/enterprise/beta/dashboard" target="_blank">IBM test cloud</a> (in Beta).</p>
<p>The real <a href="http://www.ibm.com/developerworks/websphere/techjournal/0811_col_willenborg/0811_col_willenborg.html" target="_blank">important message made here by IBM</a> is that the WAS hypervisor edition is only a first bird. Although naked manual WAS installation is not a biggy, IBM products running on WAS are. As the OVF standard matures and virtualization becomes the default production hosting environment, we will be seeing complex WAS based products (say Portal, and Process Server) shipped as ultra consumable OVF packages. Even a complete topology consisting of many servers can be delivered as a single OVF package.<br />
This delivery mode is quite similar to VMWare&#8217;s <a href="http://www.vmware.com/appliances/" target="_blank">software appliances</a>, only applicable to more than one Hypervisor when packaged as OVF (theoretically).</p>
<p>Bad news to professional services people and install manager software developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/hypervisor-edition-whats-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IBM&#8217;s PLDE seminar 2010 &#8211; Review</title>
		<link>http://www.javatuning.com/ibms-plde-seminar-2010-review/</link>
		<comments>http://www.javatuning.com/ibms-plde-seminar-2010-review/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 17:00:10 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[a glimpse into the future]]></category>
		<category><![CDATA[computer language]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[programming language]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=246</guid>
		<description><![CDATA[I spent today at the IBM Programming Languages and Development Environments Seminar 2010, that took place at the beautiful Haifa Research lab mount Carmel campus. Things worth mentioning: Gilad Bracha, father of Java Generics and auto-boxing, spent 60 minutes repenting Sun&#8217;s Java 1.0 early design mistakes, such as allowing primitives and static members into the [...]]]></description>
			<content:encoded><![CDATA[<p>I spent today at the <a href="https://www.research.ibm.com/haifa/Workshops/plde2010/program.shtml" target="_blank">IBM Programming Languages and Development Environments Seminar 2010</a>, that took place at the beautiful Haifa Research lab mount Carmel campus. Things worth mentioning:</p>
<p>Gilad Bracha, father of Java Generics and auto-boxing, spent 60  minutes repenting Sun&#8217;s Java 1.0 early design mistakes, such as allowing  primitives and static members into the language. IMHO the lecture  itself was so-so. Gilad pointed out Java&#8217;s soft spots, but didn&#8217;t bother  presenting the crowd what he views as the alternatives. What he did  suggest was to check out his new baby programing language <a href="http://en.wikipedia.org/wiki/Newspeak_%28programming_language%29" target="_blank">Newspeak</a> (something for the purists I guess).</p>
<p>Perhaps some of Java&#8217;s charm at the early days was its simplicity and  low learning curve, I&#8217;m not sure that a semantically perfect Java  (could there by anything like this?) using nested classes instead of  static members would have enjoyed the same mojo.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/04/plde20101.jpg"><img class="alignnone size-full wp-image-258" title="plde2010" src="http://www.javatuning.com/wp-content/uploads/2010/04/plde20101.jpg" alt="" width="497" height="359" /></a></p>
<p>In one additional <a href="https://www.research.ibm.com/haifa/Workshops/plde2010/abstracts.shtml#2" target="_blank">interesting lecture</a>, <em>Kathy Barabash,</em> talked about how data structures with a sequential references object graph (say a LinkedList) do not allow traditional concurrent GC Tracing algorithms to scale on many-core (i.e., massive multi-core) platforms.</p>
<p>What good is your new 1,024 cores Intel processor if the desktop widget nuclear explosion simulation flickers because it can only scale on 400 of the available cores, right?</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/04/many-core.jpg"><img class="alignnone size-full wp-image-247" title="many-core" src="http://www.javatuning.com/wp-content/uploads/2010/04/many-core.jpg" alt="" width="247" height="221" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/ibms-plde-seminar-2010-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software development podcast in Hebrew</title>
		<link>http://www.javatuning.com/software-development-podcast-in-hebrew/</link>
		<comments>http://www.javatuning.com/software-development-podcast-in-hebrew/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:53:44 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=238</guid>
		<description><![CDATA[Having recommended podcasts before, I now want to recommend Ran Tavori&#8217;s and Ori Lahav&#8217;s  great (in Hebrew) software development podcast: רברס עם פלטפורמה. Some of my favorite episodes include: 50. Content acceleration and CDNs 46. Multiple data-centers 45. references in Java 42. Garbage Collection (including myself with a guest appearance) 39. Designing products for the [...]]]></description>
			<content:encoded><![CDATA[<p>Having <a href="http://www.javatuning.com/java-podcasts-tune-in-to-the-java-posse/">recommended podcasts before</a>, I now want to recommend Ran Tavori&#8217;s and Ori Lahav&#8217;s  <a href="http://www.reversim.com/">great (in Hebrew) software development podcast: רברס עם פלטפורמה.</a></p>
<p><a href="../wp-content/uploads/2010/03/mic.jpg"><img title="mic" src="../wp-content/uploads/2010/03/mic-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>Some of my favorite episodes include:</p>
<p><a href="http://www.reversim.com/2009/12/50-cdn.html">50. Content acceleration and CDNs</a></p>
<p><a href="http://www.reversim.com/2009/11/46.html">46. Multiple data-centers</a></p>
<p><a href="http://www.reversim.com/2009/11/45-java-references.html">45. references in Java</a></p>
<p><a href="http://www.reversim.com/2009/11/42.html">42. Garbage Collection (including myself with a guest appearance)</a></p>
<p><a href="http://www.reversim.com/2009/10/39.html">39. Designing products for the military</a></p>
<p><a href="http://www.reversim.com/2009/07/25-mysql.html">28. MySQL</a></p>
<p><a href="http://www.reversim.com/2009/06/25-data-centers.html">25. Data centers</a></p>
<p><a href="http://www.reversim.com/2009/05/22.html">22. Internet products and usability in general</a></p>
<p><a href="http://www.reversim.com/2009/05/20-django.html">20. Introduction to DJango</a></p>
<p><a href="http://www.reversim.com/2009/04/18-erlang.html">18. ERLANG </a></p>
<p><a href="http://www.reversim.com/2009/04/17-key-value-databases.html">17. Key-Value DB products</a></p>
<p><a href="http://www.reversim.com/2009/04/15-aspnet.html">15. ASP.NET with Yossi Tagori</a></p>
<p><a href="http://www.reversim.com/2009/04/32-scalability.html">13. Scalability</a></p>
<p><a href="http://www.reversim.com/2009/03/10-sundaysky.html">10. SundaySky real-time video generation</a></p>
<p><a href="http://www.reversim.com/2009/02/8-debugger.html">8. think twice before you debug instead of trace</a></p>
<p>If you know any other good software development podcasts in Hebrew, please comment here to let me and the world know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/software-development-podcast-in-hebrew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ConcurrentHashMap fat memory footprint</title>
		<link>http://www.javatuning.com/concurrenthashmap-fat-memory-footprint/</link>
		<comments>http://www.javatuning.com/concurrenthashmap-fat-memory-footprint/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:55:24 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ConcurrentHashMap]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[OOME]]></category>
		<category><![CDATA[out of memory]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sizing]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=14</guid>
		<description><![CDATA[While running product sizing tests, we&#8217;ve found that an over enthusiastic usage of ConcurrentHashMap (CHM) had evaporated  a good ~170MB of much needed heap space (we ran with a 1.5GB heap). As it turns out, a empty CHM weighs around 1700B. Yes, I&#8217;m talking about a map with no entries at all, just the plumbing! [...]]]></description>
			<content:encoded><![CDATA[<p>While running product sizing tests, we&#8217;ve found that an over enthusiastic usage of <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html">ConcurrentHashMap</a> (CHM) had evaporated  a good ~170MB of much needed heap space (we ran with a 1.5GB heap).</p>
<p>As it turns out, a empty CHM weighs around 1700B. Yes, I&#8217;m talking about a map with no entries at all, just the plumbing!<br />
We used a CHM to store user session attributes, having 100,000 user sessions generated 100K CHM instances worth 170MB of heap (100K times 1.7KB).<br />
We took measurements using the super <a href="http://www.eclipse.org/mat/">Eclipse MAT</a>.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/03/85-Big-Fat-Ass.jpg"><img class="size-medium wp-image-232 alignleft" title="Fat on duty" src="http://www.javatuning.com/wp-content/uploads/2010/03/85-Big-Fat-Ass-300x195.jpg" alt="" width="180" height="117" /></a>The obvious solution for saving these scares 170MB, <strong>was to switch from a CHM to a Hashtable</strong>. A <a href="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html">Hashtable </a>cost only around 150B per instance (8% of a CHM).<br />
Other possible solutions could have been: moving to a list structure (seek time is not an issue as we rarely have more than 4-5 attributes per session), or resorting to a an array of Objects.</p>
<p><span style="text-decoration: underline;"><strong>Change implications:</strong></span></p>
<p><strong>1. Performance </strong>- The product doesn&#8217;t have any user scenario that cause multiple threads to concurrently access the same session attributes map, so we don&#8217;t expect any performance loss, on the contrary, I&#8217;m expecting a hashtable to prove faster for single thread access, over a CHM.</p>
<p><strong>2. T</strong><strong>hread safety</strong> is a low risk aspect, as both CHM and HT provide the same basic guarantees for a single API operation (e.g., map.get(key)).</p>
<p>To conclude, a CHM is a good idea when you have a shared map structure suffering from a high R/W thread access contention. But dragging behind itself such a large memory footprint, CHM is not ideal to use in masses, or when concurrency performance is not the focus.</p>
<p>P.S<br />
A CHM automatically allocates 16 segments, each with a 16-element array &#8211; one best practice is to measure the average map population during your product&#8217;s sizing tests, and initialize the CHM with the minimum initialCapcity and loadFactor, required to contain your usage.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/concurrenthashmap-fat-memory-footprint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concurrent Modification Exception</title>
		<link>http://www.javatuning.com/concurrent-modification-exception/</link>
		<comments>http://www.javatuning.com/concurrent-modification-exception/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 19:53:51 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Collections]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Thread safety]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=225</guid>
		<description><![CDATA[I ran into a ConcurrentModificationException (CME) during stress testing. What does CME actually mean? It means that you&#8217;ve modified (add, remove, update) your Collection while you&#8217;ve been iterating over it (usually in a multi-threaded fashion, but it can occur in a single thread that modifies while iterating). A few more things to note about CME: [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a ConcurrentModificationException (CME) during stress testing.<br />
What does CME actually mean?<br />
It means that you&#8217;ve modified (add, remove, update) your Collection while you&#8217;ve been iterating over it (usually in a multi-threaded fashion, but it can occur in a single thread that modifies while iterating).</p>
<p>A few more things to note about CME:<strong><br />
Best effort detection </strong>- If you see a CME printout, first off, consider yourself lucky, CMEs are thrown only in best effort. In another universe, the concurrent modification would not have been detected, causing your collection to become corrupted, instead of fast-failing with a CME.</p>
<p><strong>IDing the problem</strong> &#8211; Like deadlocks, CME&#8217;s are easy to pinpoint once you inspected the exception&#8217;s stack trace.</p>
<p><strong>Avoiding CME:</strong></p>
<ol>
<li><strong>ListIterator</strong><strong><br />
</strong>To modify a collection by the same thread that is currently iterating on it, use a <a href="http://java.sun.com/javase/6/docs/api/java/util/ListIterator.html">ListIterator</a> that will allow you to perform both.<br />
Drawbacks &#8211; single thread solution only.</li>
<li><strong>Naive solution: Synchronizers<br />
</strong>Use locks to for mutually excluding traversal and modification operations.<br />
Advantages &#8211; easy to code.<br />
Drawbacks &#8211; very long lock periods while iterating.</li>
<li><strong>CopyOnWrite</strong><br />
Take advantage of the Java.util.concurrent collections like: <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CopyOnWriteArrayList.html">CopyOnWriteArrayList</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CopyOnWriteArraySet.html">CopyOnWriteArraySet.</a> If you require a map then grab <a href="http://mina.apache.org/report/trunk/apidocs/org/apache/mina/util/CopyOnWriteMap.html">CopyOnWriteMap</a> from Apache (this guys have been doing Sun&#8217;s dirty work for years now).<br />
Advantages &#8211; very good reading performance (no locks are used, instead visibility is obtained via map member volatility).<br />
Drawbacks &#8211; very bad write performance on large maps.<br />
Conclusion &#8211; use for seldom mutating collections.</li>
<li><strong>toArray()</strong><br />
<a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html#toArray()" target="_blank">toArray</a> will create a new array holding a copy of your Set (Map.keySet() for a Map).<br />
You can then iterate over the array, freely modifying the original collection (the array doesn&#8217;t change of course).<br />
Advantages &#8211; write operations are cheap.<br />
Disadvantages &#8211; copying the entire set could be expensive if it occurs too often, and/or the set is very large.</li>
<li><strong>Concurrent Collections<br />
</strong>If you want to go heavyweight, consider using: <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html">ConcurrentHashMap</a> (or one of its package friends).<br />
Once you create an iterator over a ConcurrentHashMap (CHM), it does not freeze the collection for traversal, updates to the collection may or may not appear during the traversal (weakly consistent).</li>
</ol>
<p><strong>The approach I ended up taking</strong><br />
My use case was seldom modifying a ~ten items cache. A copyonwrite map was what I used.<br />
In other cases I had, ConcurrentHashMap was the easiest solution (though make sure your code can live in peace with the CHM weak consistency property).</p>
<div id="attachment_227" class="wp-caption alignleft" style="width: 210px"><a href="http://www.javatuning.com/wp-content/uploads/2010/02/threads.jpg"><img class="size-full wp-image-227" title="threads" src="http://www.javatuning.com/wp-content/uploads/2010/02/threads.jpg" alt="" width="200" height="285" /></a><p class="wp-caption-text">Best pic idea I could think of to visualize Threads <img src='http://www.javatuning.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/concurrent-modification-exception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NAT in VMWare vSphere/ESX &#8211; In a nut shell</title>
		<link>http://www.javatuning.com/nat-in-vmware-vsphereesx-in-a-nut-shell/</link>
		<comments>http://www.javatuning.com/nat-in-vmware-vsphereesx-in-a-nut-shell/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 19:00:40 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[appliance]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=219</guid>
		<description><![CDATA[This post is about NATing an ESX VM, but first, why do I need NAT: The SIP protocol is not NAT oblivious. To traverse NAT our application has to replace the DNS in the SIP message contact header to the external FQDN that the message receiver will be sending responses to (A NAT with static [...]]]></description>
			<content:encoded><![CDATA[<p>This post is about NATing an ESX VM, but first, why do I need NAT:</p>
<p>The SIP protocol is not NAT oblivious. To traverse NAT our application has to replace the DNS in the SIP message contact header to the external FQDN that the message receiver will be sending responses to (A NAT with static routing configured).<br />
Therefore I needed to test our software in a NAT topology.</p>
<p>In the past, when we used VMWare player/workstation, it had a build-in NAT network. But, unfortunately, <strong>the ESX hypervisor does not provide a NATed network option.</strong><br />
Seeking alternatives at <a href="http://www.vmware.com/appliances/">VMWare&#8217;s appliance marketplace</a>, I found and downloaded the Vyatta&#8217;s community edition (VC5) router appliance (also downladble from <a href="http://sourceforge.net/projects/vyatta/">sourceforge</a>), <a href="http://www.vyatta.org/getting-started/vyatta-editions">and comes under the GPL license</a>.<br />
After 3-4 hours &#8211; guided by the official <a href="http://www.vyatta.com/downloads/documentation/VC5.0.2/Vyatta_QuickStart_VC5_v03.pdf">quick start guide</a> -  I had a working NAT configuration in the ESX. Hurray!<br />
Overall, not a hard <em>nut</em> to crack <img src='http://www.javatuning.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , though I wish VMWare will wise up and just add an build-in NAT option to vSphere.</p>
<p>Left to do:<br />
Obtain some static IPs, so the config won&#8217;t break each time the vm reboots and the DHCP lease expires.<br />
Tip #1:<br />
If you want want to access your NATed VM by RDP/VNC, without setting up extra NAT routing rules, consider adding the VM an additional un-NATed NIC, but when doing so, make sure that the OS routing tables are set to route through the NIC that is NATed.<br />
Tip #2:<br />
This short <a href="http://kneew.com/node/32" class="broken_link">vyatta user installation report</a> also helped me a bit.</p>
<p>Here&#8217;s the complete configuration script I ended up feeding to the appliance console (network topology is similar to the one presented in the <a href="http://www.vyatta.com/downloads/documentation/VC5.0.2/Vyatta_QuickStart_VC5_v03.pdf">Vyatta&#8217;s getting stated guide</a>):<br />
Where:<br />
1.2.3.4 is your department&#8217;s DNS server<br />
192.168.1.199 is the VMs NATed private IP address (provided by the DHCP).<br />
The script contains a NAT forward rule for VNC (port 5900)</p>
<pre><code>
configure
set system host-name vyatta-nat
set interfaces ethernet eth0 address dhcp
set service ssh
set service https
commit;
save;
# restart the appliance to switch from console remote desktop to SSH:

#login with user and password
configure
show interfaces

set interfaces ethernet eth1 address 192.168.1.254/24

commit;

delete service dhcp-server
set service dhcp-server shared-network-name ETH1_POOL subnet 192.168.1.0/24 start 192.168.1.100 stop 192.168.1.199
set service dhcp-server shared-network-name ETH1_POOL subnet 192.168.1.0/24 default-router 192.168.1.254
set service dhcp-server shared-network-name ETH1_POOL subnet 192.168.1.0/24 dns-server 1.2.3.4
commit;
show service dhcp-server

set service nat rule 1 source address 192.168.1.0/24
set service nat rule 1 outbound-interface eth0
set service nat rule 1 type masquerade
commit;
show service nat
save;
exit
show nat rules
configure
set service nat rule 20 type destination
set service nat rule 20 inbound-interface eth0
# use a negative fake address to so that all incoming communication will be nated
#set service nat rule 20 destination address !192.168.50.0
#Forward traffic to address 192.168.1.199
set service nat rule 20 inside-address address 192.168.1.199
set service nat rule 20 protocol tcp
set service nat rule 20 destination port 5900
commit;
save;
exit
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/nat-in-vmware-vsphereesx-in-a-nut-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Java blog out there</title>
		<link>http://www.javatuning.com/new-java-blog-out-there/</link>
		<comments>http://www.javatuning.com/new-java-blog-out-there/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 16:25:05 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=206</guid>
		<description><![CDATA[A new baby blog was born: Java Tech Sharing. Proud father: Guy Moshkovich. I recommend adding to your RSS/Atom reader.]]></description>
			<content:encoded><![CDATA[<p>A new baby blog was born: <a href="http://javatechsharing.blogspot.com/" target="_blank">Java Tech Sharing</a>.<br />
Proud father: Guy Moshkovich.</p>
<p>I recommend adding to your RSS/Atom reader.<br />
<a href="http://www.javatuning.com/wp-content/uploads/2010/01/baby.jpeg"><img class="alignleft size-full wp-image-209" title="baby" src="http://www.javatuning.com/wp-content/uploads/2010/01/baby.jpeg" alt="" width="463" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/new-java-blog-out-there/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility Frenzy #1 &#8211; The log summarizer</title>
		<link>http://www.javatuning.com/utility-frenzy-1-the-log-summarizer/</link>
		<comments>http://www.javatuning.com/utility-frenzy-1-the-log-summarizer/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 01:32:46 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[utilities]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=185</guid>
		<description><![CDATA[Here&#8217;s a post I wrote (in the Hebrew language) which tells the story of the log summarizer utility that I&#8217;ve wrote. This story is the first in a line of &#8220;utilities stories&#8221; I&#8217;m planning on writing. My apologies for those of you whom won&#8217;t be able to read it. Posts in this site do appear [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here&#8217;s a <a href="http://gilinachum.com/wp/?p=219">post </a>I wrote (in the Hebrew language) which tells the story of the log summarizer utility that I&#8217;ve wrote. This <a href="http://gilinachum.com/wp/?p=219">story </a>is the first in a line of &#8220;utilities stories&#8221; I&#8217;m planning on writing.<br />
My apologies for those of you whom won&#8217;t be able to read it. Posts in <strong>this </strong>site do appear in English..</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/utility-frenzy-1-the-log-summarizer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google is pregnant again &#8211; Noop</title>
		<link>http://www.javatuning.com/google-is-pregnant-again-noop/</link>
		<comments>http://www.javatuning.com/google-is-pregnant-again-noop/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 19:43:34 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[programming language]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=179</guid>
		<description><![CDATA[After the zillion new dynamic languages that had flooded the earth (groovy, ruby, &#8230;), Google is concocting Noop; a new type-safe language to join Java, Scala, and the rest. The new language sets out to excel in testability, dependency injection, and readable code (see the proposed features). More interesting than whether Noop will gain a [...]]]></description>
			<content:encoded><![CDATA[<p>After the zillion new dynamic languages that had flooded the earth<br />
(groovy, ruby, &#8230;), Google is concocting <a href="http://code.google.com/p/noop/">Noop</a>; a new type-safe language to join Java, <a href="http://www.scala-lang.org/">Scala</a>, and the rest.</p>
<p>The new language sets out to excel in testability, dependency injection, and readable code (see the <a href="http://code.google.com/p/noop/wiki/Features">proposed features</a>). More interesting than whether Noop will gain a crowd of enthusiasts, is the language&#8217;s dynamic and lucid development process; made available through <a href="http://code.google.com/">Google code</a> (Sun&#8217;s JSRs, are also transparent but here it&#8217;s a whole new language).</p>
<p>What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/google-is-pregnant-again-noop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why is Thread.sleep() inherently inaccurate</title>
		<link>http://www.javatuning.com/why-is-thread-sleep-inherently-inaccurate/</link>
		<comments>http://www.javatuning.com/why-is-thread-sleep-inherently-inaccurate/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 19:06:09 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Multi Threading]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[estimating]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[milliseconds]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[sleep]]></category>
		<category><![CDATA[time measurment]]></category>
		<category><![CDATA[windows services]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=172</guid>
		<description><![CDATA[Avi Ribchinsky, a friend and a college of mien, is transitioning from C++ to the Java world. He had been playing with Thread.sleep(), when he noticed that the sleep method might oversleep more than ordered, and moreover, it could also under sleep (see Fig 1). Coming from the C++ world, that surely caught him surprised [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linkedin.com/in/aviribchinsky">Avi Ribchinsky</a>, a friend and a college of mien, is transitioning from C++ to the Java world. He had been playing with Thread.sleep(), when he noticed that the sleep method might oversleep more than ordered, and moreover, it could also <strong>under sleep</strong> (see Fig 1). Coming from the C++ world, that surely caught him surprised <img src='http://www.javatuning.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Fig 1.</p>
<div id="attachment_173" class="wp-caption alignleft" style="width: 594px"><a href="http://www.javatuning.com/wp-content/uploads/2009/08/sleep.JPG"><img class="size-full wp-image-173" title="sleep" src="http://www.javatuning.com/wp-content/uploads/2009/08/sleep.JPG" alt="Thread.sleep() under sleeping" width="584" height="463" /></a><p class="wp-caption-text">Thread.sleep() under sleeping</p></div>
<h2>How is sleep implemented in Java anyway?</h2>
<p>Avi came asking me if I knew anything about it, I was wondering myself how such a common and important method could be faking in the way shown above. Is it the OS? a Bug in the specific JRE version used? Maybe the API doesn&#8217;t guarantee milliseconds precision to begin with?<br />
Thinking about all of these factors, we realized that we don&#8217;t really know how the JVM implements the sleep method functionality, my best guess would have been that the process registers itself in the OS for a wake up call, and the OS wakes the process via a software interrupt. OK, time to search the web.</p>
<p>The <a href="http://www.javamex.com/tutorials/threads/sleep.shtml">following article</a> gives a very detailed answer, explaining that sleep is implemented by a thread giving up its OS scheduling quantum back to the scheduler, on the next execution quantum the thread gets, it has the chance to wake up and continue processing, or again continue sleeping.<br />
Therefore, the accuracy resolution of sleep is directly dependent on the process scheduling resolution of the operating system in usage. Since windows XP process scheduling resolution is roughly 10ms, the sleep mechanism, in the Avi&#8217;s example, might had prefered to under sleep &#8220;a little&#8221; rather than oversleeping &#8220;a lot&#8221;, by waking himself in the current scheduling cycle quantum, rather than in the next, future, quantum.</p>
<p>The article also mentions that the inaccuracies are worsened when a process with a higher scheduling priority, than the sleeping process, is in a runnable state.</p>
<p>I assume that, running on a Hypervisor with course grained process scheduling would also produce greater inaccuracies.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2009/08/sleeping.jpeg"><img class="alignleft size-medium wp-image-174" title="sleeping" src="http://www.javatuning.com/wp-content/uploads/2009/08/sleeping-300x229.jpg" alt="sleeping" width="300" height="229" /></a></p>
<h2>Conclusion</h2>
<p>You can&#8217;t rely on the millisecond accuracy of the sleep method. Take a before and after time measurament to find the actual time spent sleeping, in order to avoid ever increasing inacurracies.<br />
Sleep tight <img src='http://www.javatuning.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/why-is-thread-sleep-inherently-inaccurate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
