Hugo A. Cantor
03-22-2011, 09:38 AM
Hello,
I’m currently testing version 2.2.20110304.0. I think I see a possible memory leak in VVUPLOAD. The bufferptr pointer is set to a memory allocation in teraspace. At the end of the program an attempt is made to free the allocation by calling C_TS_free. However the call to C_TS_free does not free the allocation because by this point bufferptr does not point to the beginning of the allocation (bufferptr is moved in ParseData). A similar leak existed in the previous version using %alloc. The increase in memory usage can be seen in option 3 of wrkjob every time a large file is uploaded.
In order to free the allocation, a second pointer can be set to the beginning of the allocation right after the call to AlcMemory and pass that pointer to C_TS_free at the end of the program, and as an extra precaution, after the memory has been freed set all pointers that point anywhere in the allocation, bufferptr, globalUploadPtr in VVIN to *null.
-thanks,
Hugo A. Cantor
I’m currently testing version 2.2.20110304.0. I think I see a possible memory leak in VVUPLOAD. The bufferptr pointer is set to a memory allocation in teraspace. At the end of the program an attempt is made to free the allocation by calling C_TS_free. However the call to C_TS_free does not free the allocation because by this point bufferptr does not point to the beginning of the allocation (bufferptr is moved in ParseData). A similar leak existed in the previous version using %alloc. The increase in memory usage can be seen in option 3 of wrkjob every time a large file is uploaded.
In order to free the allocation, a second pointer can be set to the beginning of the allocation right after the call to AlcMemory and pass that pointer to C_TS_free at the end of the program, and as an extra precaution, after the memory has been freed set all pointers that point anywhere in the allocation, bufferptr, globalUploadPtr in VVIN to *null.
-thanks,
Hugo A. Cantor