0

I am investigating FloatBuffer variables of the same size in two apps, one is mainly written in Kotlin, the other in Java.

The float[] arrays named floatBuffer have the same size of 150,528 elements.

When evaluating the expression

Arrays.toString(floatBuffer.array())

the Kotlin app returns the values (Fig1) whereas the Java app throws a stackoverflow error (Fig2).

I need the Arrays.toString() to copy the result to the clipboard for further analysis in a Python project (It works well when I copy the clipboard to a text and afterwards read it in Python). Otherwise only a fraction of the data would be copied to the clipboard with an indication that there are more to show (but not displayed and copied):

e.g. [... -0.33692956, +150,428 more]

Fig1:
Fig1

Fig2: Fig2

I am quite clueless:

Does anyone know the cause of this behavior? Does the Java app in my case consume so much memory, that a stack of 1040KB is too large to be processed?

Any ideas how to overcome this by Android Studio configuration maybe? The Java app in debug mode uses 1,404M of the allocated 2,048M heap. The max heap size is 2,048M, so this not a matter here I guess.

DrT
  • 81
  • 1
  • 6

0 Answers0