Android Question [SOLVED] BLE2 and java.lang.StackOverflowError: stack size 8MB

Star-Dust

Expert
Licensed User
Longtime User
My Android device connects with a peripheral with the BLE2 library. Everything works correctly.
When I request the LOGs that are 5k long, it gives me an error. It seems like it's over the limit.

How can I solve this problem?
 

Star-Dust

Expert
Licensed User
Longtime User
I expressed myself badly, it's not the log that crashes the application. the data that the device sends is approximately 5k and the maximum that the HEAP memory can receive is 4K, this generates a crash within the library.

The ideal is that in the library there was a method that instead of transferring data into an Array transferred it directly to a file.
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Do not use LOG then. B4a LOG is restricted to 4000 bytes approx.
Write it to a file and read the file then
Rereading your message, I realized that the suggestion you gave me was correct, it was me who hadn't understood.

Reviewing the logs reporting an overflow, I found the error was a simple logical error

Thanks again for your observation, it was very useful
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…