Obsolete
Status Update
Comments
en...@google.com <en...@google.com> #2
looks like one of the leaks we already fixed.
yl...@gmail.com <yl...@gmail.com> #3
We found this bug in Android version 4.0.1. In which version you have fixed the leaks?
sa...@google.com <sa...@google.com> #4
Thank you for your feedback. We assure you that we are doing our best to address all issues reported. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with the bug report here https://goo.gl/TbMiIO and reference this bug for context.
Description
Android4.0.1/i9250 NFC p2p communication 250 times.
- What happened.
NFC p2p communication will stop for long time, about 9 seconds.
Log shows(whole log is in the attachment):
01-18 11:49:10.132: E/dalvikvm(3551): JNI ERROR (app bug): local reference table overflow (max=512)
01-18 11:49:10.132: W/dalvikvm(3551): local reference table (0x28d360) dump:
01-18 11:49:10.132: W/dalvikvm(3551): Last 10 entries (of 512):
.....
01-18 11:49:14.500: I/ServiceManager(107): service 'nfc' died
01-18 11:49:14.515: D/dalvikvm(192): GC_FOR_ALLOC freed 588K, 9% free 16529K/18119K, paused 27ms
01-18 11:49:14.515: I/ActivityManager(192): Process com.android.nfc3 (pid 3551) has died.
01-18 11:49:14.539: D/Zygote(117): Process 3551 terminated by signal (11)
01-18 11:49:14.546: D/dalvikvm(5311): Debugger has detached; object registry had 1 entries
01-18 11:49:14.546: I/ActivityManager(192): Start proc com.android.nfc3 for restart com.android.nfc3: pid=5311 uid=1025 gids={3002, 3001}
01-18 11:49:14.562: D/dalvikvm(192): GC_CONCURRENT freed 212K, 7% free 16924K/18119K, paused 2ms+3ms
01-18 11:49:14.570: I/NfcService(5311): Starting NFC service
01-18 11:49:14.578: D/NFC JNI(5311): NFC Service : loading JNI
....
- What you think the correct behavior should be.
Memory leak may happen in the JNI level of NFC Service. Most likely:
'nfc_jni_Discovery_notification_callback' function in package/app/Nfc/jni/com_android_nfc_NativeNfcManager.cpp:
if(psRemoteDevList->psRemoteDevInfo->RemDevType == phNfc_eNfcIP1_Initiator)
{
/* Set General Bytes */
f = e->GetFieldID(tag_cls, "mGeneralBytes", "[B");
TRACE("General Bytes length =");
for(i=0;i<psRemoteDevList->psRemoteDevInfo->RemoteDevInfo.NfcIP_Info.ATRInfo_Length;i++)
{
LOGD("%02x ", psRemoteDevList->psRemoteDevInfo->RemoteDevInfo.NfcIP_Info.ATRInfo[i]);
}
generalBytes = e->NewByteArray(psRemoteDevList->psRemoteDevInfo->RemoteDevInfo.NfcIP_Info.ATRInfo_Length);
e->SetByteArrayRegion(generalBytes, 0,
psRemoteDevList->psRemoteDevInfo->RemoteDevInfo.NfcIP_Info.ATRInfo_Length,
(jbyte *)psRemoteDevList->psRemoteDevInfo->RemoteDevInfo.NfcIP_Info.ATRInfo);
e->SetObjectField(tag, f, generalBytes);
}
Here 'generalBytes' use too many local reference may the reason.
Anyone encountered the same problem? Can give some advice or help?