Caution: This page is designed to consume all available RAM and CPU. Prolonged exposure may lead to system crashes, data corruption, or spontaneous combustion.
// In C
int memoryLeak = malloc(sizeof(int));
for(int i = 0; i < 1000000000; i++)
{
memoryLeak = memoryLeak + i;
}
free(memoryLeak);
// In C++
std::string memoryLeak = "";
for(int i = 0; i < 1000000000; i++)
{
memoryLeak += "a";
}
delete &memoryLeak;