<< December 2009 | Home | February 2010 >>

BufferedInputStream's Default Buffer Size Over Time

The first of a series of posts on BufferedInputStream's default buffer size
Bookmark and Share

While micro-benchmarking the performance of BufferedInputStream with various buffer sizes (both on my new fast SSD and a slow slow USB-attached HDD), the question came to mind "Has this default buffer size value changed over time in Java? And if so, who decides this? And where exactly is the line between a version of Java and a JVM."

My first instinct was to ask the boffins & peasants over at Stack Overflow: Where is exactly is the demarkation between a version of Java and the JVM? While some folks answered my main question, and one SOpedian (Joachim Sauer) went on to loosely answer my real questions, there was still not an absolute answer.

Time to take a trip down history lane via teh Google, and Sun's Java archive site.

Version Source Reference Year Bytes
JDK 1.0 API Documentation JavaDoc 1996 512
JDK 1.1 Core API Spec JavaDoc 1997 512
JDK 1.2 Sun JDK 1.2 Source Code 1998 2048
JDK 1.3 Sun JDK1.3 Source Code 2000 2048
JDK 1.4 Java 5 bug report bugs.sun.com 2002 2048
Java 5 JDK 5 Source Source code 2004 8192
Java 6 Open JDK 6 Source code 2006 8192
Java 7 Open JDK7 Beta Source code 2010 8192

So, how does that look in a graph?

Graph: ava.io.BufferedInputStream default buffer size over time

Interesting. In following posts next month, I'll compare the default buffer size of BufferedInputStream with other seemingly relevant metrics, such as Moore's Law, storage bus speeds, and hard disk size over the years.

There are other Java implementations out there, and they have their own default buffer size. I'll keep this list up to date as I learn of new JVMs.

Version Source Reference Bytes
win32 IBM 1.4.2 JRE McDowell on Stack Overflow SO Answer 2048
IcedTea6 1.4.1 (Java 6) Max A. on Stack Overflow SO Answer 8192

BufferedInputStream Default Buffer Size Series: Next

3TB of Time Machine Backup Storage for the xtendx Office

And a video with blinking lights to prove it
Bookmark and Share

At xtendx we are big on simple, effective, and most things Apple. With an office of only a few people, we don't have the need or desire for a dedicated "IT Guy" and so those responsibilities generally fall on me.

Most of us are on MacBook Pros and have been handeling our backups individually at home when convenient. Recently, my colleague Mattia also started using a MBP, and a critical mass of support developed for bringing our backups "in house". To that end, we ordered three 1TB LaCie Grand USB-attached external hard drives (designed by Neil Poulton.) At SFr120 each (approximately US$122) from Digitec they were a fair price.

The original plan was to connect all three drives to the Apple AirPort Extreme base station and have each Mac's Time Machine backup over the network. No go. Constant errors like "Error 17 creating backup disk image" and "Error: (-8062) SrcErr:NO CopyingTime", Machine/System Preferences becoming unresponsive, and other drama. Big Apple #fail.

After three hours of tinkering and following many suggestions found on the Intertubes (downgrading the AirPort firm ware to 7.5.1, reformatting to a non-journel file system, and renaming the drives to conform to 8.3 naming convention), I gave up. The three disks now site near our desks and are attached directly via USB. Not as nifty, but it works and my time is valuable.


I like the blinking lights.

Here are some of the logs. Maybe if someone out there on the Interwebs has a suggestion then I'll try agin.

Starting standard backup
Attempting to mount network destination using URL: 
afp://xtendx@xtendx%20AirPort%20Extreme._afpovertcp._tcp.local/Stu's%20Time%20Machine
Mounted network destination using URL: 
afp://xtendx@xtendx%20AirPort%20Extreme._afpovertcp._tcp.local/Stu's%20Time%20Machine
Creating disk image /Volumes/Stu's Time Machine-1/Stu Thompson’s MacBook Pro.sparsebundle
Disk image /Volumes/Stu's Time Machine-1/Stu Thompson’s MacBook Pro.sparsebundle mounted 
at: /Volumes/Time Machine Backups
Backing up to: /Volumes/Time Machine Backups/Backups.backupdb
Ownership is disabled on the backup destination volume.  Enabling.
Backup content size: 129.6 GB excluded items size: 12.0 GB for volume Manoa SSD
No pre-backup thinning needed: 141.11 GB requested (including padding), 926.89 GB available
Waiting for index to be ready (101)
Error writing to backup log.  NSFileHandleOperationException:*** -[NSConcreteFileHandle 
writeData:]: Input/output error
Error: (-36) SrcErr:NO Copying /Applications/Stargate.Universe.S01E10.720p.HDTV.x264-SiTV.mkv 
to /Volumes/Time Machine Backups/Backups.backupdb/Stu Thompson’s MacBook 
Pro/2010-01-18-132728.inProgress/8289BDA1-B63B-4F3C-9277-936B11355DA5/Manoa SSD/Applications
Stopping backup.
Error writing to backup log.  NSFileHandleOperationException:*** -[NSConcreteFileHandle 
writeData:]: Input/output error
Error: (-8062) SrcErr:NO Copying /Applications/Stargate.Universe.S01E10.720p.HDTV.x264-SiTV.mkv 
to /Volumes/Time Machine Backups/Backups.backupdb/Stu Thompson’s MacBook 
Pro/2010-01-18-132728.inProgress/8289BDA1-B63B-4F3C-9277-936B11355DA5/Manoa SSD/Applications
Stopping backupd to allow ejection of backup destination disk!
Error writing to backup log.  NSFileHandleOperationException:*** -[NSConcreteFileHandle 
writeData:]: Input/output error
Error writing to backup log.  NSFileHandleOperationException:*** -[NSConcreteFileHandle 
writeData:]: Input/output error
Copied 16560 files (6.1 GB) from volume Manoa SSD.
Error writing to backup log.  NSFileHandleOperationException:*** -[NSConcreteFileHandle 
writeData:]: Input/output error
Copy stage failed with error:11

Adobe AIR MIME type for Apache Tomcat 6

Win7/IE8 will mischievously rename the file .zip if the MIME type is not set server side
Bookmark and Share

Is your Windows 7/ Internet Explorer 8 browser magically renaming .air files (Adobe AIR applications) as zip files when downloading them from an Apache Tomcat server? Well, have not fear! Stu is here!

You just need to edit conf/web.xml file and add the following MIME type code snippet:

 <mime-mapping>
  <extension>air</extension>
  <mime-type>application/vnd.adobe.air-application-installer-package+zip</mime-type>
 </mime-mapping>

Now, just restart your Tomcat instance and the .air files will download as expected.