To stop forgotten Remote Desktop sessions holding memory on a shared Windows server, set a time limit for disconnected sessions, and optionally for idle ones, under Remote Desktop Session Host > Session Time Limits in Group Policy. By default Windows keeps disconnected and idle sessions without any limit, so a user who simply closes the window can leave programs running for days.
Disconnected is not signed out
Closing the Remote Desktop window, or losing the network, disconnects a session. The programs stay open on the server and keep using memory, and some may keep files or records open. Signing out ends the session. Staff often do not know the difference, which is why a server that was comfortable on Monday feels tight by Thursday.
See who is holding what
On the server, in an elevated prompt:
query userThe output lists each session with its ID, state (active or disconnected) and idle time, counted in minutes since the last keyboard or mouse input. In Task Manager's Users tab you can compare memory per user. To end one session after speaking to its owner:
logoff SESSION-IDLogging someone off closes their programs, and unsaved work can be lost. Warn them first.
The four settings that matter
Open gpedit.msc on a standalone server, or a Group Policy object in a domain, and go to Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits.
- Set time limit for disconnected sessions. When the limit is reached, the disconnected session is deleted from the server. This is the safest first setting. Microsoft notes it does not apply to console sessions.
- Set time limit for active but idle Remote Desktop Services sessions. Applies when a connected user stops interacting.
- Set time limit for active Remote Desktop Services sessions. Caps total connected time. Most small offices do not need it.
- End session when time limits are reached. Changes the outcome for active and idle limits from disconnecting to ending the session. Read its description carefully: ending a session discards whatever was not saved.
Policies also exist at user scope under User Configuration. Pick one place and document it, so that two settings do not leave you guessing which wins.
A starting policy for a small office
These are suggestions to adjust, not Microsoft recommendations:
- Disconnected sessions: end after a few hours, long enough to survive a power cut, a broadband drop or a lunch break.
- Idle sessions: disconnect after one to two hours. Leave "End session when time limits are reached" off at first.
- Active sessions: no limit.
- Exceptions: if an account runs a long export or a trading terminal that must stay up, do not apply the limits blindly. A server whose job is to keep a terminal running while you are disconnected should normally not delete disconnected sessions at all.
Also consider the policy that restricts each user to a single session. With it, a returning user reconnects to the disconnected session instead of starting a second one.
Roll it out without surprising anyone
- Record
query userand memory use at the busy hour for a few days. - Tell staff the new limits and ask them to save work and sign out at the end of the day.
- Apply the settings, run
gpupdate /force, and sign in again so the session picks them up. - Test with a spare account: open an unsaved file, disconnect, and wait out a short temporary limit.
- Review after a week and compare memory at the same hour.
What staff will notice, and how to explain it
Most complaints after a change like this come from surprise rather than from the limit itself. A short note to the team usually covers it: closing the window is not the same as signing out; a dropped connection can be picked up again within the allowed time; after that time the session and anything unsaved inside it are gone. Ask people to sign out from the Start menu at the end of the day, and to save before stepping away. Name one person who can change the limit, so that a month-end exception is agreed in advance and removed afterwards. If someone repeatedly needs long-running jobs, consider running them as a scheduled task under a dedicated account instead of keeping an interactive session open overnight, and check that the task finishes and writes its output where the team expects it.
When limits are not enough
Limits recover memory from sessions nobody is using. If memory is full while everyone is genuinely working, the server is too small. RDP VPS Wala plans around 1.5 to 2 GB per active session: VPS 8 has 8 GB, VPS 16 has 16 GB and VPS 32 has 32 GB, listed with prices on the plans section. Remember that session limits do not change licensing: RDS CALs are still required for users beyond administration. Questions go to the FAQ or the contact section; the wider server range is on VPSWala Cloud VPS.