title: Java performance problem with LinkedBlockingQueue
body: <p>this is my first post on stackoverflow... I hope someone can help me </p>
  
  <p>I have a big performance regression with Java 6 <code>LinkedBlockingQueue</code>. 
  In the first thread i generate some objects which i push in to the queue
  In the second thread i pull these objects out. The performance regression occurs when the <code>take()</code> method of the <code>LinkedBlockingQueue</code> is called frequently.
  I monitored the whole program and the <code>take()</code> method claimed the most time overall. 
  And the throughput goes from ~58Mb/s to 0.9Mb/s...</p>
  
  <p>the queue pop and take methods ar called with a static method from this class </p>
  
  <pre><code>public class C_myMessageQueue {
  
      private static final LinkedBlockingQueue&lt;C_myMessageObject&gt; x_queue = new LinkedBlockingQueue&lt;C_myMessageObject&gt;( 50000 );
  
      /**
       * @param message
       * @throws InterruptedException
       * @throws NullPointerException
       */
      public static void addMyMessage( C_myMessageObject message )
              throws InterruptedException, NullPointerException {
          x_queue.put( message );
      }
  
      /**
       * @return Die erste message der MesseageQueue
       * @throws InterruptedException
       */
      public static C_myMessageObject getMyMessage() throws InterruptedException {
          return x_queue.take();
      }
  }
  </code></pre>
  
  <p>how can I tune the <code>take()</code> method to accomplish at least 25Mb/s, or is there a other class I can use which will block when the "queue" is full or empty. </p>
  
  <p>kind regards </p>
  
  <p>Bart</p>
  
  <p>P.S.: sorry for my bad english, I'm from Germany ;)</p>