Created
August 7, 2017 19:23
-
-
Save Oxore/e0c487cdd191ba03d61e74f40a7e8cd3 to your computer and use it in GitHub Desktop.
А теперь чисто крестовая утечка
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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