This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Memory leak causes the android upper restart

hi,all

file :android2.3.4/frameworks/base/include/ui/InputManager.h

class:class InputManager : public InputManagerInterface

I make the following changes

from:
--------------------
private:
    sp<InputReaderInterface> mReader;
    sp<InputReaderThread> mReaderThread;

    sp<InputDispatcherInterface> mDispatcher;
    sp<InputDispatcherThread> mDispatcherThread;

    void initialize();

--------------------
to:
--------------------
private:
    sp<InputReaderInterface> mReader;
    sp<InputReaderInterface> mReader1; //Add a variable
    sp<InputReaderThread> mReaderThread;

    sp<InputDispatcherInterface> mDispatcher;
    sp<InputDispatcherThread> mDispatcherThread;

    void initialize();
--------------------

As above, I add a variable, leading to memory leaks, android upper restart.

I do not know why.

  • Hi Yanhong,

    1. You must be doing more than what you have mentioned over here..

    2. Could you paste logcat over here to have more analysis ?

    BR,

    satish

  • Hi, satish

    Thank you for your reply.

    logcat:5611.log.txt.

    I try to set the property "setprop libc.debug.malloc 10"to debug, but when I add this property it is working properly .

  • I run the following command to compile ,it has the previously mentioned errors.Compile the module, rather than to compile the overall
    $ cd TI_Android_GingerBread_2_3_4Sources/
    $ . build/envsetup.sh
    $ cd frameworks/base/libs/ui/
    $ mm -B TARGET_PRODUCT=am3517evm


    It works well after I compiled the whole source codes.
    $ cd TI_Android_GingerBread_2_3_4Sources/
    $ make TARGET_PRODUCT=am3517evm

    Who knows what is the reason?

  • Hi yanhong,

    Sorry for late reply

    1. From the log it has been seen, it is crashing in libc

    01-01 00:04:07.835: INFO/DEBUG(2408):          #00  pc 00013d06  /system/lib/libc.so
    01-01 00:04:07.835: INFO/DEBUG(2408):          #01  pc 000144be  /system/lib/libc.so

    May be malloc or some other C roution..

     

    2. As you mentioned it has as fixed the problem after setting property for malloc... I think that might be the cause..

     

    BR,

    satish