3 ms·
There was a board that over the course of two weeks would get progressively and perceptibly slower. Looking into it the heap was full of tiny allocations that n
by mzs 13y ago
There was a board that over the course of two weeks would get progressively and perceptibly slower. Looking into it the heap was full of tiny allocations that nobody knew where they were coming from. What had happened is that someone had compile with the C++ compiler instead of the C compiler the file that had an interrupt handler. This was running in kernel context and the older compiler decided that there had been no data-structure allocated to keep tabs on exceptions for that thread, so it it malloced that little bitsy chunk in the from the function prolog - every time the interrupt occurred, about 15Hz in practice. Eventually it was taking tasks a longer and longer time to find free blocks in the fragmented heap. The quick solution was to add nothrow to the file ;)