An interviewer just asked me a peculiar question I hadn't thought about before.
"How would you fill the memory of a computer as fast as possible in C#?"
I answered that I would probably use some kind of recursive function, however he pointed out I would probably get a stack overflow before filling the memory.
My question is simply, how would I fill the memory of a computer as fast as possible using C#?
memset() is used to fill a block of memory with a particular value. The syntax of memset() function is as follows :
Method 3: increase memory of C drive via a handy software 1 You can also use AOMEI Partition Assistant command lines to extend C drive. Just input following command lines and... 2 For the target partition is system partition, the operation will be completed under AOMEI Partition Assistant PreOS... More ...
While browsing Windows forums, we find many users report their hard drive space disappearing. Although they don't store any more files on the drive, and even if they delete some files, their C drive keeps filling up. Here is a true example we extract from answers.microsoft.com:
memset () is used to fill a block of memory with a particular value. Note that ptr is a void pointer, so that we can pass any type of pointer to this function. Let us see a simple example in C to demonstrate how memset () function is used: char str [50] = "GeeksForGeeks is for programming geeks.";
I'd go with a fork-bomb:
while (true) Process.Start(Assembly.GetExecutingAssembly().Location);
The concept is familiar, the program endlessly starts new instances of itself.
I haven't tried it, but I'd go with something like:
while(true) { Marshal.AllocHGlobal(1024); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With