memory

B

bob

if modern OSes free up memory for processes when they die,
why does rebooting Windows XP improve performance so much more than
closing all programs?
 
V

Victor Bazarov

if modern OSes free up memory for processes when they die,
why does rebooting Windows XP improve performance so much more than
closing all programs?

You should troll^H^H^H^H^Hask your question in a Microsoft Windows
programming newsgroup.

V
 
P

Phlip

bob said:
if modern OSes free up memory for processes when they die,
why does rebooting Windows XP improve performance so much more than
closing all programs?

This is an off-topic question which can easily sustain on-topic answers.

Your program's "heap" is the arena that returns storage for objects created
by 'new'.

A program's heap, on a desktop operating system, is one extent of storage
within a larger system heap. (So large OSs typically use a "heap of heaps".)

The Windows heap of heaps can push some pages of storage out to a swapper
file, to make room for other pages that are used more often.

The memory address your program uses is fake. The OS converts it to a real
address, and maybe swaps that address's contents back from the swapper file,
before the address gets as far as hardware memory.

Each time your program allocates memory from a heap, the OS might need to
allocate more storage from the heap-of-heaps for your program. All these
allocations typically follow a "first fit" algorithm. The memory manager
scans for the first block of unused storage larger than the request.

As a program allocates and deallocates, its memory fills up with small
unallocated blocks. A large, dynamic program should frequently rebalance its
objects in memory - moving them with a custom allocator, for example - to
compact the heap. That will leave larger blocks of free memory ready for the
next allocation, so that will be faster.

The Windows heap compaction system sucks.

An OS must compact its heap-of-heaps aggressively. And, in theory, this
process should be easier for an OS than a program, because the OS can move
memory simply by adjusting the real pointers that back up your program's
virtual pointers.

However, the Windows XP heap is widely known to fragment early and often.
Even if you close many programs, the OS is full of dynamic link libraries
that remain in memory after their programs discard them. When these have
data - even garbage - the OS defends them. And even if you cleared out these
libraries, I suspect that the XP heap would still be fragmented, _and_ its
representation in the swapper file would be fragmented too.

Rebooting will generally compact this heap!

Further questions on this topic belong on a newsgroup with winxp and kernel
in its name. I suspect you will learn there that Windows servers typically
schedule to reboot once a week.
 
V

Victor Bazarov

Phlip said:
This is an off-topic question which can easily sustain on-topic
answers.

But you managed to give an off-topic one. Why? To vent? To show off?
Your program's "heap" is the arena that returns storage for objects
created by 'new'.

A program's heap, on a desktop operating system, [..]

And why didn't you mention a cell phone operating system or a set-top
box operating system?
The Windows heap of heaps can [..]

Discussions on particular platforms are OT, don't you know?
The memory address your program uses is fake. [..]

That's platform-specific. On DOS, it isn't. Or did you mean "on his
particular platform"?
The Windows heap compaction system sucks.

*Shrug* Millions of users never complained.
An OS must compact its heap-of-heaps [..]

And another OS doesn't have to...
However, the Windows XP heap is widely known to [..]

Another broad generalization. Platform-specific. Trolling.
Rebooting will generally compact this heap!

Nonsense. Rebooting doesn't compact the heap. It blows it away and
creates another one. Besides, how is this all relevant to comp.lang.c++?
Further questions on this topic belong on a newsgroup with winxp and
kernel in its name. [...]

This is the only on-topic sentence out of the entire tirade. *Sigh*

V
 
T

Tomás

posted:
if modern OSes free up memory for processes when they die,
why does rebooting Windows XP improve performance so much more than
closing all programs?


Memory fragmentation.


-Tomás
 
Z

Zara

if modern OSes free up memory for processes when they die,
why does rebooting Windows XP improve performance so much more than
closing all programs?


Because XP means Xtraperformance by Powercycling
 
B

Bill Baka

Zara said:
Because XP means Xtraperformance by Powercycling

Ummm,
Because Windows never seems to perform decent garbage collecting or
releasing once used memory. I noticed this by accident while monitoring
my Internet connection and Windows XP (other versions too) just kept
opening new ports in sequence when they were blocked by my firewall. I
suspect the same thing happens in just about all programs, especially
those that Microsoft writes. I have 1 GB of memory and no paging file,
yet it keeps telling me I am out of swap file space even when I have
nothing loaded and am doing something trivial. Bill Gates must be in
cahoots with the memory manufacturers, like buy 3 GB and the problem
will go away, until Vista 64, then all bets are off. I have to use
Windows for work and my daughters, but given a chance I will put in a
Linux drive and have fun.
Bill Baka (newbie here).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top