'GDB using STM32 on Mbed: "virtual memory exhausted"

I am trying to debug an application using GDB on the Mbed Windows 10 operation system. However, after a few steps, GDB always fails with the error:

/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.

A problem internal to GDB has been detected, further debugging may prove unreliable.

How can I solve this problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source