Memory consumption increases indefinitely when an extra multiply operation is added to one line of code

56 Views Asked by At

I have a C/C++ project running on an embedded Linux device (ARM Cortex A9).

I can SSH into the device while it is running, and check the process stats with "top"

I have narrowed down my issue to one line of code.

temp = 1.2*buf[j]-w*buf[j+1];

Where temp is a double, buf is a double array, w is a double, and j is int32.

When the code runs, the memory usage of the application continues to increase until it crashes (~10 minutes)... If I change the line to say

temp = buf[j]-w*buf[j+1];

The memory consumption does NOT increase!

What is going on? I have never encountered anything like this.

0

There are 0 best solutions below