TCG memory leak with FreeDOS 'edit' qemu trunk as of today leaks memory FAST when freedos' edit is running. To reproduce, download: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.3/cdrom.iso Then run: $ qemu-system-i386 -cdrom cdrom.iso select your language then select "return to DOS", then type > edit it will consume memory at ~10MB/s This does NOT happen when adding -enable-kvm Note, this also occurs with freeDOS 1.2, at least. Note 2, 4.2 stable does not exhibit the bug. Confirmed, this is still reproducible with the current v5.2-rc4... This is an automated cleanup. This bug report has been moved to QEMU's new bug tracker on gitlab.com and thus gets marked as 'expired' now. Please continue with the discussion here: https://gitlab.com/qemu-project/qemu/-/issues/283 Just to repeat the work around discussed on the GitLab page: -accel tcg,tb-size=32 will prevent the rapid increase of memory due to self modifying code. There are two justifications for making this change. The first is that i386 emulation is typically for smaller machines where having a 1gb of generated code is overkill for basic emulation. The second is the propensity of self-modifying code (c.f. Doom/edit) utilised on i386 systems can trigger a rapid growth in invalidated and re-translated buffers. This is seen in bug #283. Execution is still inefficient but at least the host memory isn't so aggressively used up. That said it's still really just a sticking plaster for user convenience. Signed-off-by: Alex Bennée