Open tkoziara opened 7 years ago
All memory should be released by ISPCSync(). Could you trace what allocation is causing troubles? You can basically hack ISPCAlloc/ISPCLaunch/ISPCSync in tasksys.cpp and add printf tracing to see what memory locations were allocated and which were released.
I just did little debugging: 8192 bytes keep getting allocated at tasksys.cpp:363 and reassigned to index 1 memBuffers[] array at tasksys.cpp:365; they never get released --> the deallocation in at tasksys.cpp:305 is never invoked; I am guessing: this shows up due to the long argument list of the tasking function causing allocation of memBuffers[1] at launch not matched by a deallocation at sync;
Dear All,
The code I work on experiences significant memory leak, reported as follows by valgrind:
The forces function is called many times (every time step during a simulation) and it launches several taks: here is the reported line 1287.
The ISPC version is 1.9.1 and the tasksys.cpp file used here comes from this version. The line 1191 in tasksys.cpp can be viewed here.
I hope that you would be able to comment about why there could be a memory leak like this. The software is indeed eating up memory when the "springs_task" at line 1287 is being called -- and not doing this when this line is commented out. There is not memory allocation within the task function.
Best regards, Tomek