Makes sense to preload much of code segment to make startup go faster. Must also allocate more backing store when extend address space via something like malloc. Just manipulate data structure in kernel memory that maintains state for backing store page allocation. A system thrashes if physical memory is too small to hold the working sets of all the processes running. The upshot of thrashing is that pages always spend their time waiting for the backing store to fetch their pages.
Thrashing is a discrete phenonmenon.
Usually, there is a phase transition from no thrashing to thrashing. Typical way thrashing came about in early batch systems. Scheduler brought in new process whenever CPU utilization goes down. Eventually the size of the working sets become larger than physical memory, and processes start to page. The CPU utilization drops even further, so more processes come in, and the system starts to thrash.