java - What does it mean when application goes idle -


i'm reading virtual memory swapping , says pages of memory can swapped when application becomes idle. i've tried google means haven't found elaborate information except this stackoverflow answer:

your winforms app driven message loop pulls messages out of queue. when queue emptied, message loop enters quiet state, sleeping efficiently until next message appears in message queue. helps conserve cpu processing resources (cycles wasted spinning in loop takes cpu time away other processes running on machine, feels slower) , helps reduce power consumption / extend laptop battery life.

so application become idle when there's no messages in message queue?

the operating system decides idle means. in general, means application doesn't actively utilize system resources (like processor cycles, io operations, etc).

however, doesn't mean application's pages in memory not swapped if application isn't 'idle'. there may many 'active' applications contend same limited physical memory , os may forced swap pages belonging active application make room active application.


Comments