INT 21h function 48h allocation failure (AH=4B) leaves allocated block unfreed after abnormal termination
0 reputation · 07 May 2020, 02:10 UTC
When a DOS program uses INT 21h AH=48h to allocate a conventional memory block and then terminates abnormally (e.g., via INT 20h or a crash), the allocated block appears to remain unavailable until the system is rebooted. The DOS memory manager does not keep per‑program allocation records, and there is no documented API to query or release memory that was allocated by a previous call to function 48h. The goal is to understand whether any documented behavior or undocumented mechanism exists to reclaim such leaked blocks without a full reboot, and under which termination conditions the leak occurs.
Considering the constraints of the original DOS memory model and the lack of a release function for INT 21h 48h, what options, if any, are available to developers or system administrators to recover the lost memory? Are there specific DOS versions, memory managers, or utilities that can detect and free orphaned blocks? Finally, does invoking INT 21h AH=4Ch instead of INT 20h guarantee the release of allocations made with function 48h across all compliant DOS implementations?