Solution: FUTEX_WAIT hangs Java on Linux / Ubuntu in vmware or virtual box

Posted by: Pratik Patel on 2010-01-24 19:52:00.0

Ok, I'm documenting this for those that hit this same problem. Is it taking a LONG time to run some Java app, making it seemingly hang? This happens  when running Ubuntu or any flavour of Linux in VMware or Virtual Box. I d/l a pre-made image of Ubuntu Server 9.10 from http://www.thoughtpolice.co.uk/vmware/, put JDK 1.6_18 on it, and went on with installing some app servers and other stuff for setting up a Hudson SWARM.

I attempt to start some Java procs, and they took a long time to start. I broke out strace to see what the hell was going on, and it seems that the procs were getting stuck in FUTEX_WAIT. Googling FUTEX_WAIT lead to many false solutions. Further examination of the strace pointed to some stuff happening in /dev/random just before the FUTUX_WAIT. On a hunch, I reconfigured the /dev/random like so:

rm /dev/random 

mknod -m 644 /dev/random c 1 9 

and VOILA! things started working normally. Hopefully, you get here via a google search and find this solution to save you a couple of hours of agony. 



About Pratik Patel

Pratik Patel

Pratik Patel is the CTO of Atlanta based TripLingo (http://www.triplingo.com/). He wrote the first book on 'enterprise Java' in 1996, "Java Database Programming with JDBC." He has also spoken at various conferences and participates in several local tech groups and startup groups. He's in the startup world now and hacks iOS, Android, HTML5, CSS3, JavaScript, Rails, and ..... well everything except Perl.

Pratik's specialty is in large-scale applications for mission-critical and mobile applications use. He has designed and built applications in the retail, health care, financial services, and telecoms sectors. Pratik holds a master's in Biomedical Engineering from UNC, has worked in places such as New York, London, and Hong Kong, and currently lives in Atlanta, GA.

More About Pratik »

SpringOne 2GX

September 9 - 12, 2013

Santa Clara, CA

Current Topics on the NFJS Tour

  • Core Java, JEE
  • Dynamic Languages: Groovy, JRuby, Scala, Clojure
  • RESTful Web Apps
  • Frameworks: Hibernate, Grails, Spring, JSF, GWT, more
  • Agility
  • Test Driven Design
  • Security
  • Ajax, Flex, RIA
View Event Details »

NFJS, the Magazine

2013-03-01 00:00:00.0 Issue Now Available
  • Having Fun with Play Framework

    by Nilanjan Raychaudhuri
  • Test-Driven iOS Development in Ruby with RubyMotion: Part 1

    by Brian Sam-Bodden
  • Java Unit Testing with Spock

    by Ken Sipe
  • Concurrency with GPars: Part I — Using Asynchronous Methods

    by Venkat Subramaniam
Learn More »