Wt Bad Allocation messages, how can I prevent these?
After a number of reloads (F5) our application shows the following message: Error occurred bad allocation
It appears to be random, independent of browser and OS, sometimes every third or fourth reload, sometimes only after reloading 25 times.
Has anybody encountered similar problems or does somebody know where I should start looking?
I am using Wt 4.0.5 VC, I have tested on Chrome, Firefox and Edge.
Updated by Roel Standaert over 3 years ago
I think that means a
std::bad_alloc exception was thrown. That could be for all sorts of reasons. You may be running out of memory (maybe due to a memory leak), or you're trying to allocate a lot of memory, maybe accidentally due to undefined behavior (I recently saw this occur where it tried a allocate a huge amount of memory because the amount it tried to allocate was a bogus value).
You can try setting a break point when
std::bad_alloc is thrown, using a tool to check for memory leaks or memory issues like Valgrind, not sure about tools on Windows, maybe Dr. Memory (https://github.com/dynamorio/drmemory).