By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

memory

P: n/a
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?

Apr 18 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
bo*@coolgroups.com wrote:
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
--
Please remove capital As from my address when replying by mail
Apr 18 '06 #2

P: n/a
bob wrote:
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.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 18 '06 #3

P: n/a
Phlip wrote:
bob wrote:
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.


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
--
Please remove capital As from my address when replying by mail
Apr 18 '06 #4

P: n/a
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
Apr 18 '06 #5

P: n/a
On 17 Apr 2006 17:04:34 -0700, bo*@coolgroups.com wrote:
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
Apr 19 '06 #6

P: n/a
Zara wrote:
On 17 Apr 2006 17:04:34 -0700, bo*@coolgroups.com wrote:
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


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).
Apr 21 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.