OSDev.org
https://forum.osdev.org/

Is it feasible to make a program thrash on purpose?
https://forum.osdev.org/viewtopic.php?f=13&t=56337
Page 1 of 1

Author:  billy91 [ Mon Jun 27, 2022 6:38 am ]
Post subject:  Is it feasible to make a program thrash on purpose?

I understand what thrashing is, but after completing an operating systems course at university, I was wondering if it is feasible to intentionally cause a program to thrash, or if today's operating systems are "too smart" to fall for such tricks.

Is it possible to make my application spend more time loading pages than executing code?

Author:  linguofreak [ Mon Jul 11, 2022 8:10 pm ]
Post subject:  Re: Is it feasible to make a program thrash on purpose?

billy91 wrote:
I understand what thrashing is, but after completing an operating systems course at university, I was wondering if it is feasible to intentionally cause a program to thrash, or if today's operating systems are "too smart" to fall for such tricks.

Is it possible to make my application spend more time loading pages than executing code?


Applications, per-se, do not thrash, because, in general, the application does not have control over which of its pages are loaded or not. *Systems* thrash. If the total set of applications running on the system uses much more memory than the system has installed RAM, and are not designed with good locality of reference (which might not be possible, depending on what the application needs to do), and the system is configured with sufficient swap to fulfill the memory requirements of the various applications, then the system will thrash. To deliberately cause a system to thrash, you don't need to do much more than allocate as much memory as the OS will let you, and then just keep writing to the memory you allocated, with each write going to a completely random location. This assumes, of course, that the system has sufficient swap space. If no swap is configured, or the amount of swap configured is much less than the RAM available, then the system won't thrash no matter what you do.

Author:  Jiyahana [ Mon Feb 05, 2024 4:43 am ]
Post subject:  Re: Is it feasible to make a program thrash on purpose?

billy91 wrote:
I understand what thrashing is, but after completing an operating systems course at university, I was wondering if it is feasible to intentionally cause a program to thrash, or if today's operating systems are "too smart" to fall for such tricks.

Is it possible to make my application spend more time loading pages than executing code?

It's possible to induce thrashing intentionally by overwhelming virtual memory but modern OS are designed to resist such manipulation.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/