Skip to content

Instantly share code, notes, and snippets.

@Oxore
Created August 7, 2017 19:23
Show Gist options
  • Save Oxore/e0c487cdd191ba03d61e74f40a7e8cd3 to your computer and use it in GitHub Desktop.
Save Oxore/e0c487cdd191ba03d61e74f40a7e8cd3 to your computer and use it in GitHub Desktop.
А теперь чисто крестовая утечка
#include <iostream>
#include <string.h>
#include <stdlib.h>
#define N 10000000
using namespace std;
class ss {
public:
int arr[100000];
ss() { for (int i = 0; i < 100000; i++) arr[i] = 1; }
};
int main()
{
void *a;
while (1) {
a = new ss;
printf("%ld bytes allocated and occupied \n", N);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment