<?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 Nov 2011 13:26:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.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>HPEL – A fast binary logging for WebSphere v8</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/hv7xfGLjdBM/</link>
		<comments>http://www.javatuning.com/hpel-a-fast-binary-logging-for-websphere-v8/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 13:26:07 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=320</guid>
		<description><![CDATA[Troubleshooting Java EE apps running on WebSphere just got a bit easier with WebSphere v8&#8242;s new binary logging and tracing mechanism: HPEL (High Performance Extensible Logging). HPEL provides logging/tracing run-time performance boost (x3.5-x5 claimed) increasing the chances that you&#8217;ll be able to turn on tracing on a production system. HPEL comes with two offline viewing&#8230;]]></description>
			<content:encoded><![CDATA[<p>Troubleshooting Java EE apps running on WebSphere just got a bit easier with WebSphere v8&#8242;s new binary logging and tracing mechanism: <a href="http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.was_v8/was/8.0/ProblemDetermination/WASv8_HPEL/player.html">HPEL (High Performance Extensible Logging)</a>.<br />
HPEL provides logging/tracing run-time performance boost (x3.5-x5 claimed) increasing the chances that you&#8217;ll be able to turn on tracing on a production system.<br />
HPEL comes with two offline viewing tools: A crafty command-line tool for log analysis, and a web based traces viewer on the Web admin console (handy for remote servers).</p>
<p>The command line utility has a tail function and can filter by: Logger/Thread ID/Time/Server startup instance/etc. Which is a good enough reason for me to get rid of my (slow performing) custom Python based filtering scripts.</p>
<p>Good old legacy text based logs are still supported but are recommended for development mode only.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2011/11/binary-text.jpg"><img class="alignleft size-full wp-image-321" title="binary-text" src="http://www.javatuning.com/wp-content/uploads/2011/11/binary-text.jpg" alt="" width="200" height="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/hpel-a-fast-binary-logging-for-websphere-v8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/hpel-a-fast-binary-logging-for-websphere-v8/</feedburner:origLink></item>
		<item>
		<title>10 things I like about Android development</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/lZ8gxZ7pU0E/</link>
		<comments>http://www.javatuning.com/10-things-i-like-about-android-development/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 15:03:55 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=305</guid>
		<description><![CDATA[Java &#8211; Write in Java on both the Client and Server sides. Simplifies development and presents a low learning curve for newcomers. Paid apps culture - Unlike when using web apps, mobile app users we&#8217;re tamed to pay for the apps they like (Thank you Apple for cracking the ice). Developing for Android might be&#8230;]]></description>
			<content:encoded><![CDATA[<ol>
<li><strong>Java</strong> &#8211; Write in Java on both the Client and Server sides. Simplifies development and presents a low learning curve for newcomers.</li>
<li><strong>Paid apps culture </strong>- Unlike when using web apps, mobile app users we&#8217;re tamed to pay for the apps they like (Thank you Apple for cracking the ice). Developing for Android might be the first time that you&#8217;ll sell a piece of software <em>directly </em>to your users (it is my first time, and I&#8217;ve been programming since 1996).</li>
<li><strong><a href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">TTD</a></strong> &#8211; When creating a new Android Eclipse project it auto suggest to create matching test project. Proves to show that the Eclipse perspective designer had TTD in mind.</li>
<li><strong><a href="http://developer.android.com/resources/samples/ApiDemos/index.html" target="_blank">API Demos</a></strong> &#8211; Good samples project to copy code segments from. Bundled with the SDK.</li>
<li><strong>No single point of entry </strong>- No single main() function. Your application  can have multiple entry points (<a href="http://developer.android.com/guide/topics/fundamentals/activities.html" target="_blank">Activities</a>), which can be used to  service the user&#8217;s <a href="http://developer.android.com/guide/topics/intents/intents-filters.html" target="_blank">Intents</a>. Different from what I&#8217;m used to.</li>
<li><strong><a href="http://developer.android.com/guide/topics/ui/declaring-layout.html" target="_blank">Construct UI using XML</a> </strong>- specifying UI elements using a markup language makes more sense than doing it programmatically (attention Swing).</li>
<li><strong>Multiple App markets</strong> &#8211; More choices for us developers.</li>
<li><strong><a href="http://developer.android.com/guide/topics/resources/more-resources.html#Dimension" target="_blank">Coping with multiple device resolutions</a></strong> &#8211; using density independent pixels worked well for my modest needs.</li>
<li><strong><a href="http://appinventor.googlelabs.com/about/" target="_blank">App Inventor</a> </strong>- Ridiculously easy to build your first app. Go try it.</li>
<li><strong>What&#8217;s your 10th?</strong> Comment if you have one.</li>
</ol>
<h3>My first App:</h3>
<p><a href="http://www.javatuning.com/wp-content/uploads/2011/04/hi-256-2-d47bd4b1848d98268cb94c21e7f3a256b36b8ae7.png"><img class="alignleft size-full wp-image-309" title="hi-256-2-d47bd4b1848d98268cb94c21e7f3a256b36b8ae7" src="http://www.javatuning.com/wp-content/uploads/2011/04/hi-256-2-d47bd4b1848d98268cb94c21e7f3a256b36b8ae7.png" alt="" width="256" height="256" /></a>My first app is the <a href="https://market.android.com/details?id=com.gilinachum&amp;feature=search_result" target="_blank">Weight Watchers Points Tracker</a> (diet related), that I&#8217;ve initially created for my own usage, then later posted to the Android Market. Surprisingly it has been doing pretty good (&gt;10K installations). I&#8217;ll need to see what comes next&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/10-things-i-like-about-android-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/10-things-i-like-about-android-development/</feedburner:origLink></item>
		<item>
		<title>Spice up your tests – execute in (repeatable) random order</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/EHu2QMPsinc/</link>
		<comments>http://www.javatuning.com/spice-up-your-tests-execute-in-repeatable-random-order/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 21:56:35 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=299</guid>
		<description><![CDATA[We have a series of SIPp tests that periodically runs against a SIP server we develop. The tests repository keeps on growing and we&#8217;ve gathered up a nice pile of tests. As good tests should be isolated from one another, their order of execution is arbitrary by definition. The tests should produce the same results&#8230;]]></description>
			<content:encoded><![CDATA[<p>We have a series of SIPp tests that periodically runs against a SIP server we develop. The tests repository keeps on growing and we&#8217;ve gathered up a nice pile of tests.</p>
<p>As good tests <a href="http://stackoverflow.com/questions/2669414/choose-order-to-execute-junit-tests" target="_blank">should be isolated from one another</a>, their order of execution is arbitrary by definition. The tests should produce the same results consistently regardless of where they are located in the execution chain. I thought I might take this to the test, and perhaps find a bug or two along the way.<br />
Working in Python, I now simply shuffle the list of tests prior to execution:<br />
<code><br />
random.shuffle(testList)<br />
executor.exec(testList)<br />
</code></p>
<p>Nice. Now what happens if a certain execution order fails? I would find the issue and fix it, what else?! Right, but how will I reproduce the same exact execution order that failed before, in order to validate the fix?<br />
One naive option is saving the entire execution order as a list of indices, this is not very comfortable. A simpler option is to simply seed your random object with the <em>same </em><a href="http://en.wikipedia.org/wiki/Random_seed" target="_blank">seed</a> int value used during the execution to reproduce. Here&#8217;s the code:<br />
<code><br />
import random<br />
seedValue = options.get('shuffleSeed', random.randint(0, 10000))  # Seed is provided by the user in an attempt to reproduce, otherwise it's set to some random value.<br />
random.seed(seedValue)<br />
random.shuffle(testList)<br />
print 'Shuffled with seed=' + str(seedValue)<br />
executor.exec(testList)<br />
</code></p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2011/03/shuffling.jpg"><img class="alignleft size-full wp-image-300" title="shuffling" src="http://www.javatuning.com/wp-content/uploads/2011/03/shuffling.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/spice-up-your-tests-execute-in-repeatable-random-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/spice-up-your-tests-execute-in-repeatable-random-order/</feedburner:origLink></item>
		<item>
		<title>Case insensitive Map key – code smell</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/QalkBIlqP_4/</link>
		<comments>http://www.javatuning.com/the-maps-key-case-insensitivity-code-smell/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 18:05:40 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[case sensitivity]]></category>
		<category><![CDATA[code smell]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[programming language]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=290</guid>
		<description><![CDATA[Here&#8217;s the bug that had me working today (a Sukot holiday): _myMap.put(key.toLowerCase()) ... _myMap.get(key) // without lower casing the key. At first you might think of this as a common human error, but I claim that it&#8217;s no less of a code smell: Why trust yourself to always remember to lower/upper case all of the&#8230;]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the bug that had me working today (a Sukot holiday):<br />
<code><br />
_myMap.put(key.toLowerCase())<br />
...<br />
_myMap.get(key) // without lower casing the key.<br />
</code><br />
At first you might think of this as a common human error, but I claim that it&#8217;s no less of a <strong>code smell:</strong></p>
<p>Why trust yourself to always remember to lower/upper case all of the interactions with the map? What about trusting others?<br />
So, instead of using a HashMap, use an Apache <a href="http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/CaseInsensitiveMap.html">CaseInsensitiveMap</a> that nicely and safely encapsulates this key&#8217;s case concern.</p>
<p>P.S.<br />
I would expect <a href="http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/CaseInsensitiveMap.html">CaseInsensitiveMap</a> to become a part of the Java SDK.</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/09/toLowerCase.png"><img class="alignleft size-medium wp-image-291" title="toLowerCase" src="http://www.javatuning.com/wp-content/uploads/2010/09/toLowerCase-300x297.png" alt="" width="300" height="297" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/the-maps-key-case-insensitivity-code-smell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/the-maps-key-case-insensitivity-code-smell/</feedburner:origLink></item>
		<item>
		<title>My attempts with IP Spoofing – Revisited</title>
		<link>http://feedproxy.google.com/~r/JavaTuning/~3/hl2Fh8_Xf9Q/</link>
		<comments>http://www.javatuning.com/my-attempts-with-ip-spoofing-revisited/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 15:51:13 +0000</pubDate>
		<dc:creator>Gili Nachum</dc:creator>
				<category><![CDATA[network]]></category>
		<category><![CDATA[IP spoofing]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://www.javatuning.com/?p=269</guid>
		<description><![CDATA[One upon a time (Jan 2009) I&#8217;ve written this post, basically saying that you&#8217;re not likely to be able to spoof IP address over the Internet. Turns out I was dead wrong! It happened so the very experienced Mr Filipe, from Brazil, came across the post and left me a comment saying that Spoofing over&#8230;]]></description>
			<content:encoded><![CDATA[<p>One upon a time (Jan 2009) I&#8217;ve written <a href="http://www.javatuning.com/ip-spoofing-%E2%80%93-only-in-a-lan/">this post</a>, basically saying that you&#8217;re not likely to be able to spoof IP address over the Internet.<br />
Turns out I was dead wrong!</p>
<p>It happened so the very experienced Mr Filipe, from Brazil, came across the post and left me a comment saying that Spoofing over the internet is quiet possible.<br />
I replied surprised, and after a number of comments ping-pongs, we started chatting online, and Felipe had agreed to give me a live spoofing demo:<br />
On my end, I&#8217;ve configured my home router to forward TCP/UDP packets to my desktop, where I ran a wireshark network capture to monitor any incoming packets.<br />
Then Felipe sent a burst of packets from random IP source addresses. Proving me that IP spoofing over the Internet is a reality indeed.</p>
<p>(<em>What do you think? Isn&#8217;t this kind of stuff is what makes the Internet  so amazingly wonderful? two people from two different parts of the world, united by  joint interest and kindness <img src='http://www.javatuning.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em>)</p>
<p><a href="http://www.javatuning.com/wp-content/uploads/2010/09/mask.gif"><img class="size-full wp-image-270 alignright" title="mask" src="http://www.javatuning.com/wp-content/uploads/2010/09/mask.gif" alt="" width="250" height="250" /></a>So,<strong> Thank you Filipe!</strong></p>
<p>A few notes on why spoofing might *not* work:</p>
<ol>
<li>According to Filipe, the recipient&#8217;s ISP is much more likely to block the spoofed packet, than the sender&#8217;s ISP. For example if the recipient&#8217;s ISP see a <a href="http://www.countryipblocks.net/bogons/">bogon </a>source IP.<br />
That&#8217;s a bit counter-intuitive, because, assuming the ISPs really do care about preventing spoofing, it&#8217;s a very easy job for the sender&#8217;s ISP to tell if the packet&#8217;s source IP is one of the IPs that it handed out to customers, or moreover, to the particular customer (sender).</li>
<li>If you are behind a NAT device, then any source address you are planning to use (be it spoofed or real) will be overwritten by the NAT anyway, so make sure you are on a real public IP.</li>
<li>No reason to get excited. TCP spoofing is very limited as you won&#8217;t make it across the TCP handshake, because the recipients will send their ACK,SYN response to the spoofed IP, which you probably don&#8217;t have much control over.<br />
In a LAN things are a bit different, if you can manipulate the recipient&#8217;s ARP table to think that the spoofed IP MAC address is yours. I haven&#8217;t dag deep.</li>
</ol>
<p><em>Feel free to comment.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javatuning.com/my-attempts-with-ip-spoofing-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.javatuning.com/my-attempts-with-ip-spoofing-revisited/</feedburner:origLink></item>
		<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[general]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[a glimpse into the future]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[OVF]]></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&#8230;]]></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" class="broken_link">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>2</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[Java]]></category>
		<category><![CDATA[a glimpse into the future]]></category>
		<category><![CDATA[computer language]]></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&#8230;]]></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>
		<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[general]]></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&#8230;]]></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[Java]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[Multi Threading]]></category>
		<category><![CDATA[ConcurrentHashMap]]></category>
		<category><![CDATA[efficiency]]></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!&#8230;]]></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[Java]]></category>
		<category><![CDATA[Multi Threading]]></category>
		<category><![CDATA[Collections]]></category>
		<category><![CDATA[exceptions]]></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:&#8230;]]></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" class="broken_link">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>
	</channel>
</rss>

