Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GetBufferLock timed out for thread

I am developing on Android Samsung galaxy TAB 10.1. After I official updated to 4.0.4 version often get error:

11-01 17:04:35.382: E/gralloc(11657): GetBufferLock timed out for thread 11657 buffer 0x55 usage 0x33 LockState 1

and device immediate restarts. This error appear totally random and if I am debugging my own applications.

Any suggestion?

P.S.

My only one infinite paint loop:

public void run() {
    Canvas canvas = null;

    while (true) {
        try {
            Thread.sleep(50);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        try {
            synchronized (lock) {
                if (!invalidated)
                    continue;
            }

            canvas = mHolder.lockCanvas();

            synchronized (mHolder) {
                onDraw(canvas);
            }

            synchronized (lock) {
                invalidated = false;
            }
        } finally {
            if (canvas != null) {
                mHolder.unlockCanvasAndPost(canvas);
                canvas = null;
            }
        }

        synchronized (lock) {
            if (painter == null)
                break;
        }
    }
}
like image 398
neworld Avatar asked Nov 01 '12 15:11

neworld


1 Answers

I guess something is wrong this the GPU memory, are you doing some heavy graphic display when this error occurs ?

if not... maybe another app is.

It's worth checking for app with heavy GPU consumption ( Probably an heavy live wallpaper ? ) and remove it. then a reboot should fix this.

also just be aware that you should never ever write :

while (true) {
}

at least add a running flag :

while(running){
}

so you can set running to false on application stop.

like image 199
Guian Avatar answered Oct 02 '22 21:10

Guian