Re: Recover/defrag memory API
- From: lacutis@xxxxxxxxx
- Date: 11 Jul 2005 09:25:51 -0700
How do you know that his solution won't work in your case? Did you try
it? I actually took the time to look the functions up in msdn and they
appear to be what you are looking for. VirtualAlloc allows you to
allocate a buffer directly in virtual memory and VirtualFree from says
it releases and then decommits the memory. This would have the
appearance of increasing the size of your program while you were using
the virtual buffer then shrinking back down when you are finished with
it. If all you are concerned about is the appearance of memory use to
your users this is a solution.
The only reason I can think of that this "wouldn't work" is if you were
reading those huge files in and out of memory as the application is
running, which I'm hoping isn't the case as that would be extremely
wasteful.
> I asked how it was done and the reply was that there was no
> such APIs, (or at least the ones that do exists don't do the job we are lead
> to believe).
There was a reply, that was a link to an article that explained EXACTLY
how these "memory optimizers" work, which is exactly how Joe also
explained it. They work by allocating a huge amount of memory which
causes every other programs allocated memory to get paged to the swap
file which increases the "available" memory indicator in windows. You
know, until a program start using those pages and they eventually get
paged back into physical memory. Eventually it hits a threshold and
forces everything to the swap again. The performance results of that
are pretty obvious.
.
- Follow-Ups:
- Re: Recover/defrag memory API
- From: Simon
- Re: Recover/defrag memory API
- References:
- Recover/defrag memory API
- From: Simon
- Re: Recover/defrag memory API
- From: Joseph M . Newcomer
- Re: Recover/defrag memory API
- From: Simon
- Re: Recover/defrag memory API
- From: Joseph M . Newcomer
- Re: Recover/defrag memory API
- From: Simon
- Re: Recover/defrag memory API
- From: Joseph M . Newcomer
- Re: Recover/defrag memory API
- From: Simon
- Recover/defrag memory API
- Prev by Date: Re: How to convert PDF file to Text using VC++ 6.0
- Next by Date: Re: resizing dialog frame "grabber"
- Previous by thread: Re: Recover/defrag memory API
- Next by thread: Re: Recover/defrag memory API
- Index(es):
Relevant Pages
|