Menu: Misc > Modify > Flush Undo History
Clears the undo / redo history of the current drawing to free memory.