Android Game development error :Too many open files
<p>I am developing an android game and i tried to set a background of the MenuView of my game, how ever when i run it, after 1 min it will be force closed.
error messages: 1.Could not create 966656-byte ashmem mark stack: Too many open files
                2.dvmHeapBeginMarkStep failed; aborting
                3.VM aborting
i've spent a whole night and nothing works....does anyone know how to fix that?</p>

<pre><code>//MenuView
@Override
public void surfaceDestroyed(SurfaceHolder holder) {

     boolean retry = true;
     while (retry){
         try {
             thread.join();
             retry = false;
         }catch ( InterruptedException e){
             //try again shutting down the thread
         }
     }

}


protected void onDraw(Canvas canvas) {
     canvas.drawBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.background), 0,0,null);

}



//MenuViewThread
public MenuViewThread( SurfaceHolder surfaceHolder, MenuView menu){
    super();
    this.surfaceHolder = surfaceHolder;
    this.menu = menu;
}

@Override
public void run() {
      Canvas canvas;
      while (running) {
       canvas = null;
       // try locking the canvas for exclusive pixel editing on the surface
       try {
        canvas = this.surfaceHolder.lockCanvas();
        synchronized (surfaceHolder) {
         // update game state
         // draws the canvas on the panel
         this.menu.onDraw(canvas);
        }
       } finally {
        // in case of an exception the surface is not left in
        // an inconsistent state
        if (canvas != null) {
         this.surfaceHolder.unlockCanvasAndPost(canvas);
        }
       } // end finally
      }
}
</code></pre>
