Parallel-LZ77 icon indicating copy to clipboard operation
Parallel-LZ77 copied to clipboard

std::bad_alloc

Open WithHades opened this issue 5 years ago • 0 comments

When I run the plz77_1.exe to compress the data of chr22.dna, the program runs a error: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc

I debug the code and find out the error happend in the rangeMin.cpp: line 39 to line 41:
parallel_for(intT i=0;i<depth;i++) { table[i] = new intT[n]; }

when the error is occured, the depth is 21 and the n is 23035842. I run the code: int main() { int** table = new int*[21]; for (int i = 0; i < 21; i++) { table[i] = new int[23035842]; } return 0; } it's ok. So I think this error is related to memory leak, but I checked the code and released the applied objects, the problem is still unresolved.

Can you help me solve this problem? thx.

WithHades avatar Feb 13 '20 06:02 WithHades