There is an old report in Debian BTS about memory used growing indefinitely.
Accordingly to the package documentation, undo history is infinite.
Even closing all the draws in qcad, the memory used isn't freed.
This can make memory used by qcad grow indefinitely.
It was reported for 126.96.36.199-1 but is still present on 188.8.131.52-1
Details on Bug#305097. Patches from community are welcome