<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Java Tuning</title>
	
	<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>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JavaTuning" /><feedburner:info uri="javatuning" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>“Hypervisor edition” – what’s that?</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/APbjpxbJT_w/</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>
		<feedburner:origLink>http://www.javatuning.com/hypervisor-edition-whats-that/</feedburner:origLink></item>
		<item>
		<title>IBM’s PLDE seminar 2010 – Review</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/M_Frd3CdMcE/</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" class="broken_link">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" class="broken_link">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>
		<feedburner:origLink>http://www.javatuning.com/ibms-plde-seminar-2010-review/</feedburner:origLink></item>
		<item>
		<title>Software development podcast in Hebrew</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/AEaj705CGh0/</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>
		<feedburner:origLink>http://www.javatuning.com/software-development-podcast-in-hebrew/</feedburner:origLink></item>
		<item>
		<title>ConcurrentHashMap fat memory footprint</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/CIWx54hxCWY/</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>
		<feedburner:origLink>http://www.javatuning.com/concurrenthashmap-fat-memory-footprint/</feedburner:origLink></item>
		<item>
		<title>Concurrent Modification Exception</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/dvx9d20H-jU/</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>
		<feedburner:origLink>http://www.javatuning.com/concurrent-modification-exception/</feedburner:origLink></item>
		<item>
		<title>NAT in VMWare vSphere/ESX – In a nut shell</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/ElO3R-xt1qU/</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>
		<feedburner:origLink>http://www.javatuning.com/nat-in-vmware-vsphereesx-in-a-nut-shell/</feedburner:origLink></item>
		<item>
		<title>Myth busting – String.intern() object allocations are never garbage collected</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/BPko5H34-bY/</link>
		<comments>http://www.javatuning.com/myth-busting-string-intern-object-allocations-are-never-garbage-collected/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 16:07:29 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[memory]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[multithreading]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=212</guid>
		<description><![CDATA[Java is becoming quite old (version 1.0 came out in 1996 if I&#8217;m not mistaken). When something turns old, legends, myths, and other perceived truths are quick to form around it (just imagine an old Gothic mansion with its stack of scare tales). Most of the accumulated knowledge is beneficial and helpful, but some of [...]]]></description>
			<content:encoded><![CDATA[<p>Java is becoming quite old (version 1.0 came out in 1996 if I&#8217;m not mistaken). When something turns old, legends, myths, and other perceived truths are quick to form around it (just imagine an old Gothic mansion with its stack of scare tales).<br />
Most of the accumulated knowledge is beneficial and helpful, but some of it is not relevant anymore or just plain wrong.<br />
Remembering that Java is 14 yeas old (2010), when I google for something, for Java info/answers, I always inspect the date of the article I landed on.<br />
If you stumble upon somebody claiming that java can/can&#8217;t do something, always check his comment&#8217;s date. If I see something from 2001, you better search for newer references, instead of accepting it as is.</p>
<p><img class="alignleft size-thumbnail wp-image-216" title="old-woman-748479" src="http://www.javatuning.com/wp-content/uploads/2010/01/old-woman-748479-150x150.jpg" alt="old" width="150" height="150" />Some sites like <a href="http://Javaworld.com">http://Javaworld.com</a>, have been there from the get go, were big then, but after losing popularity, are now a grave yard for old Java skeletons (I myself have a not that relevant <a href="http://www.javaworld.com/javaworld/jw-12-2006/jw-1201-dst.html">article there).</a></p>
<p>The story with String.intern() is the same, you&#8217;ll find people all around the place, claiming that over using it will finish up the perm area, because the perm area is never garbage collected. As discussed <a href="http://stackoverflow.com/questions/1091045/is-it-good-practice-to-use-java-lang-string-intern/2012661#2012661">here</a>, that&#8217;s just not true.</p>
<p>Something I enjoy doing is not taking so called &#8220;facts&#8221; as granted, and re-validating on my IDE.<br />
Thinking that those intern() allocations will never be GCed, I was planing a presentation on how to use weakHashMap based solution can serve as an alternative cache repository for Strings, wrote a program to demonstrate an OMME caused by intern() only to find out that intern() is not so bad  as I originally thought.<br />
Try stuff yourself. You be surprised&#8230;</p>
<p>Other myths I&#8217;ll should wright about some day are:</p>
<ol>
<li><strong>Regular expressions in Java are slow &#8211; FALSE!</strong> I&#8217;ve tested this myself, and after compiling the regex, I was able to run over than 1 million matches per second (small strings of course).</li>
<li><strong>Always use StringBuffer to concatenate strings &#8211; dead wrong! </strong>if you have all concatenations in a single line, like the following, the compiler auto does it for you:<br />
s= <em>&#8220;Hi my name is: &#8220;+myName+ &#8220;. my lucky number is: &#8220;+num;</em><br />
Run Javap on a class file using and not using StringBuffer to see that the byte code is the same.<br />
Though this piece of code could benefit from StringBuffer to prevent rapid object creation:<br />
<em>for (&#8230;) {<br />
s += strOfThisCycle;<br />
}<br />
</em>In any case, Java5 introduces StringBuilder which is the unsynchronized tween of the synchronized StringBuffer class. I guess you will rarely access the same builder from different threads, therefore StringBuilder should be the default choice for ya.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/myth-busting-string-intern-object-allocations-are-never-garbage-collected/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/myth-busting-string-intern-object-allocations-are-never-garbage-collected/</feedburner:origLink></item>
		<item>
		<title>New Java blog out there</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/81oPk473ABY/</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>
		<feedburner:origLink>http://www.javatuning.com/new-java-blog-out-there/</feedburner:origLink></item>
		<item>
		<title>Utility Frenzy #1 – The log summarizer</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/LfTvPBUmTxQ/</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>
		<feedburner:origLink>http://www.javatuning.com/utility-frenzy-1-the-log-summarizer/</feedburner:origLink></item>
		<item>
		<title>Google is pregnant again – Noop</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/OC9JFdH8WyE/</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>
		<feedburner:origLink>http://www.javatuning.com/google-is-pregnant-again-noop/</feedburner:origLink></item>
	</channel>
</rss>
