문제

For purpose of an academic project I want to create a simple program to hang a computer by consuming all available RAM. I tried creating a string and increase its length using a while loop like string=string+string2. I takes so much time when string2 is short, even though I could use 100% ram but at last I get a OutOfMemoryException and so much memory is freed. Is there any effective way of doing this?

도움이 되었습니까?

해결책

Not entirely possible as the OS will deal with the memory management thus you wont be able to do what you are trying to do especially in managed code. I also don't believe that an academic programme will have a course or instruct students to develop something like this. question sounds a little wierd

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top