Max size for std::vector
Posted: Mon Sep 04, 2023 9:02 am
Hello, i'm using large std::vector in my code. In some rare eventualities one of them grow larger than 32k.
My code crashes when i perform a push_back in a vector<u8> that has 32768 elements. If i catch the exception I have std::bad_alloc and it's like libsupc++/new_op.cc @ line 54
I have esp_get_free_heap_size() ~ 87k
I can ofc make a workaround to keep vectors smaller, but is there a quicker solution and why does it happen?
My code crashes when i perform a push_back in a vector<u8> that has 32768 elements. If i catch the exception I have std::bad_alloc and it's like libsupc++/new_op.cc @ line 54
I have esp_get_free_heap_size() ~ 87k
I can ofc make a workaround to keep vectors smaller, but is there a quicker solution and why does it happen?