记忆 [英] memory

查看:72
本文介绍了记忆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果现代操作系统在死机时为进程释放内存,那么为什么重新启动Windows XP可以提高性能,而不是关闭所有程序?

关闭所有程序?

解决方案

bo *@coolgroups.com 写道:

如果现代操作系统在死机时为进程释放内存,那么为什么重启Windows XP可以提高性能,而不是关闭所有程序?




你应该troll ^ H ^ H ^ H ^ H ^在Microsoft Windows

编程新闻组中解决你的问题。


V

-

请在邮寄回复时从我的地址中删除资金


bob写道:

如果现代操作系统在死机时为进程释放内存,那么为什么重启Windows XP会提高性能,而不是关闭所有程序?




这是一个偏离主题的问题,可以很容易地维持主题答案。


您的程序''堆"是一个为所创建的对象返回存储的竞技场

由''new''。

桌面操作系统上的程序堆是一个存储范围

在更大的系统堆中。 (所以大型操作系统通常使用堆堆。)


堆的堆堆可以将一些存储页面推送到交换器

文件,为更频繁使用的其他页面腾出空间。


程序使用的内存地址是假的。操作系统将其转换为真正的

地址,并且可能在地址到达硬件内存之前将交换器文件中的内容转换回来的交换。




每次程序从堆中分配内存时,操作系统可能需要

从程序堆堆中分配更多存储空间。所有这些

分配通常遵循先适合分配。算法。内存管理器

扫描大于请求的第一个未使用存储块。


当一个程序分配和解除分配时,它的内存填满了小

未分配的块。一个大型的动态程序应经常重新平衡其内存中的对象
对象 - 例如,使用自定义分配器移动它们 - 以使
压缩堆。这将为下一次分配

留下更大的可用内存块,这样会更快。


Windows堆压缩系统很糟糕。


操作系统必须积极地压缩其堆积。而且,从理论上讲,对于操作系统而言,这个过程应该比程序更容易,因为操作系统可以通过调整支持程序的真实指针来移动内存
's
虚拟指针。


然而,众所周知,Windows XP堆早期和经常碎片。

甚至如果你关闭了很多程序,那么操作系统就会充满动态链接库

,它们会在程序丢弃后留在内存中。当这些数据具有数据 - 甚至是垃圾 - 操作系统会为它们辩护。即使你清除了这些

库,我怀疑XP堆仍然会碎片化,而且它在交换器文件中的表示也会碎片化。


重新启动通常会压缩这个堆!


关于此主题的更多问题属于具有winxp和内核的新闻组

在它的名字。我怀疑你会在那里学到Windows服务器通常每周安排重启一次。


-

Phlip
http://www.greencheese.org/ZeekLand < - NOT博客!!!


Phlip写道:

bob写道:

如果现代操作系统免费为死亡时的进程提供内存,为什么重启Windows XP会提高性能,而不是关闭所有程序?
这是一个非常容易维持主题的非主题问题
答案。




但是你设法给了一个非主题的。为什么?发泄?炫耀?

你的程序''堆'返回由'new创建的对象存储的竞技场。

程序的堆,在桌面操作系统上,[..]


为什么你没有提到手机操作系统或机顶盒
盒操作系统?

Windows堆堆可以[...]


关于特定平台的讨论是OT,你不知道吗?

程序使用的内存地址是假的。 [..]


这是特定于平台的。在DOS上,它不是。或者你的意思是在他的

特定平台上??

Windows堆压缩系统很糟糕。


*耸耸肩*数以百万计的用户从不投诉。

操作系统必须压缩其堆积[...]

而另一个操作系统并不需要...

但是,Windows XP堆已广为人知[...]


另一个广泛的概括。特定于平台的。拖钓。

重新启动通常会压缩这个堆!


废话。重新启动并不会压缩堆。它吹走了它,而b $ b又创造了另一个。此外,这与comp.lang.c ++有什么关系?

关于这个主题的进一步问题属于名称中包含winxp和
内核的新闻组。 [...]




这是整个长篇大论中唯一的主题句。 *叹气*


V

-

请在邮寄回复时从我的地址中删除资金


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?

解决方案

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


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!!!


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


这篇关于记忆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆