Article View: borland.public.cppbuilder.nativeapi
Article #7537Preventing memory block from swapping to disk
From: Tumurbaatar S.
Date: Wed, 19 Jan 2005 08:04
Date: Wed, 19 Jan 2005 08:04
18 lines
2000 bytes
2000 bytes
I need to lock several MB of memory in RAM. I had read some topics of Win32 Ref, but somethings are not clear for me: 1. Global/LocalAlloc() with GMEM_FIXED is enough to get a non-swappable memory block? 2. Or I need VirtualAlloc() with MEM_COMMIT and VirtualLock()? 3. Because VirtualLock() can lock only a small portion of memory (30 * 4K), I have to SetProcessWorkingSetSize(), but how to determine a minimum working set size for the process? Memory I need + X..., how much more? 4. The Min/Max heap size values in Project Options | Linker have any relation to all above I'm talking? 5. The memory I need to lock, is used to store a large sorted list with many items in it and new items are constantly added/removed from the list. Also values of items also changes constantly. "Constantly" means that I expect up to 1000 requests (for add/remove/change) per second. Because my program so often access this memory block (whole memory block, not some portion of it), will system keep it in RAM by default? Thank you!
Technical Details
Message-ID:
<41ee1494@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!feeder1.cambrium.nl!feed.tweaknews.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c5b636ba1001447d,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Tumurbaatar S." <nospam_tumur@magicnet.mn> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Preventing memory block from swapping to disk Date: Wed, 19 Jan 2005 16:04:35 +0800 Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 NNTP-Posting-Host: 202.131.2.6 Message-ID: <41ee1494@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106121876 202.131.2.6 (19 Jan 2005 00:04:36 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!feeder1.cambrium.nl!feed.tweaknews.nl!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail