Hi Jaehong,
I've seen your patch this morning, but I still found some memory leak issues 
that cause application crashed after few minutes due to JNI local reference 
table overflow. (My client just keeps polling to server every 5 seconds)
I think I've found where the memory leak occurs although I'm not sure why 
they're not handled by JVM. Based on your patch, I add few lines in EDR 
implementation to prevent memory leak and now it has been tested to run for 
thirty minutes without crash. Once I confirm the patch does fix the issue, I 
can try to submit it.
Thank you!


Best Regard, === Yu-Hsin Hung,Electrical Engineering and Computer Science 
Undergraduate Honors Program, National Chiao-Tung Universiry, Hsinchu 300, 
Taiwan (Phone) +886911012113(Email) hungys at hotmail.com (Website)  
http://hungys.logdown.com/ ===

Date: Mon, 3 Aug 2015 08:25:49 +0000
From: [email protected]
Subject: Re: [dev] [Android] JNI local reference table overflow (CA)
To: hungys at hotmail.com; iotivity-dev at lists.iotivity.org







Hi, Yu-Hsin.



Recently we found an issue in CA with BT transport where InputStream is created 
for each BT read.
So I had fixed that problem and submitted patch @ 
https://gerrit.iotivity.org/gerrit/#/c/2017/



With above fix, we are able to transmit the data between devices using CA 
sample as BT support is not yet integrated with RI and samples.



Please check the latest version. If you have the same problem, log a jira 
ticket with debug log.
(Scons build using option RELEASE = 0) @ http://jira.iotivity.org




Regards,
Jaehong.





------- Original Message -------

Sender : Hung Yu-Hsin<hungys at hotmail.com>

Date : 2015-07-30 18:29 (GMT+09:00)

Title : [dev] [Android] JNI local reference table overflow (CA)





Hi All, 


Recently I found that the multi transport restriction of Android in CA's scons 
script is removed, so I tried to build a new aar to support IP/EDR/LE 
simultaneously.


My application runs well before I added reference to the new aar, although it 
only support IP adapter due to IoTivity limitation. After integrate with the 
new aar, the Android sample app: simpleclient and simpleserver, work great with 
Bluetooth EDR connection, but often crashed on my application.


Basically my client will do polling to server periodically (assume 5s), and the 
app always crashed after about one minute. The log says there is an error: "JNI 
ERROR (app bug): local reference table overflow (max=512)", so I guess there 
are some issues in the CA implementation.


Also, if I set the period more frequently, almost no operation will succeed 
(findResource, get...), I suspect the implementation of EDR is not thread-safe, 
so the data operation on the Bluetooth interface will lead to unexpected 
behavior?


Here are some logs of my application for this issue: http://pastie.org/10319711


Thanks!



Best Regard, === Yu-Hsin Hung,
Electrical Engineering and Computer Science Undergraduate Honors Program, 
National Chiao-Tung Universiry, Hsinchu 300, Taiwan 
(Phone) +886911012113
(Email) hungys at hotmail.com (Website)  http://hungys.logdown.com/ ===






-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150803/42f5fb62/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 201508031725659_BEI0XT4N.gif
Type: image/gif
Size: 13168 bytes
Desc: not available
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150803/42f5fb62/attachment.gif>

Reply via email to