NOutOfMemoryError on Android application

General information about Neurotechnology and its software

NOutOfMemoryError on Android application

Postby carlosmagno » May 06, 2019 19:13


I"m dealing with a peculiar error.
It occurs not always, but after the first occurrence it continues to occur until the device is turned off. The error does not disappear if the device is restarted. Also, this error is holding on to a specific device: Samsung Galaxy J2 Prime (SM-G532MT) running Android 6.0.1.

The error is:
Code: Select all
com.neurotec.lang.NOutOfMemoryError: Out of memory

Code: Select all

The stack trace:
Code: Select all
java.lang.RuntimeException: One or more errors occurred
   at com.neurotec.lang.NResult.checkAll(
   at com.neurotec.lang.NResult.raiseError(
   at com.neurotec.lang.NResult.check(
   at com.neurotec.biometrics.NBiometricEngine.createTemplate(
Caused by: com.neurotec.util.concurrent.NAggregateExecutionException: One or more errors occurred
   at com.neurotec.util.concurrent.ConcurrentUtilErrorCreator.create(
   at com.neurotec.lang.ChainedErrorCreator.create(
   at com.neurotec.lang.NError.get(
   at com.neurotec.lang.NError.get(
   at com.neurotec.lang.NError.getLast(
   at com.neurotec.lang.NResult.checkUnchecked(
   ... 5 more
Caused by: com.neurotec.lang.NOutOfMemoryError: Out of memory
   at com.neurotec.lang.RuntimeErrorCreator.create(
   at com.neurotec.lang.ChainedErrorCreator.create(
   at com.neurotec.lang.NError.get(
   at com.neurotec.lang.NError.get(
   ... 8 more

The template creation method is called from:
Code: Select all
private static NSubject createSubjectFromImage(NBiometricClient client, byte[] image) throws Exception {
   NImage nImage = null;
   NSubject subject = new NSubject();
   NFace face = new NFace();

   ByteBuffer buffer = ByteBuffer.wrap(image);
   nImage = NImage.fromMemory(buffer);
   NBiometricStatus status = client.createTemplate(subject);
   if(status != NBiometricStatus.OK){
      throw new Exception(status.toString());
   return subject;

Although the error is related to a supposed lack of memory, analysis of the application heap and system memory usage information shows that the device has available memory at the moment of the error.
I would like to know what information I should fetch to try to figure out what might be causing this error.

Posts: 1
Joined: May 03, 2019 18:53

Re: NOutOfMemoryError on Android application

Postby MartynasV » May 07, 2019 09:19


Please provide SDK revision number(can be found in SDK root directory, in Revision.txt file).
Martynas V
Posts: 507
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Return to Public

Who is online

Users browsing this forum: No registered users and 2 guests