🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6036

Re: How to Make Sure that Buffer use ONLY memory

#6036
From: Daniel
Date: Sun, 12 Jun 2005 09:02
69 lines
3609 bytes
>Have you actually tried to run it without the fancy memory locks, to
>see if your intuition is right?

No, i haven't tried that yet becouse i'm just starting now to
build my application, BUT, i know that it whould have to do LOT
of calculations, and i estimate that it will take it several
months of continuous operating to get the final results, now
it's not a secret that an approaching to the hard-drive is much
slower than an approaching to a real memory, so it's not a
question of trying, it's just a fact. additional to that, 
tremendous number of hard-drive approaches will eventually
erode the hard disk and also enlarge the possibility of 
reading or writing wrong data to and from that buffer, i want 
the buffer to be as reliable as possible, and a real memory is 
much more reliable than a hard-drive, as a fact. 


>Have you investigated the VirtualLock functions that Liz mentioned?

Yes i read yesterday a lot about this subject, but i'm still 
not sure if i understand how to use this method, i'm also not
sure if it will work on my Windows-XP with my builder 4.0


>How much memory do you realy need? A couple MB, no problem.

I need AS MUCH AS POSSIBLE, my computer have 256 MB, if it's 
possible i want to use ALL the 256 MB.


>Have you heard of a method called double buffering?

I heard, but i have no idea how does it relate to my issue, if
possible please explain how can it help me here.


>You might also want to check out CreateFileMapping and MapViewOfFile
>especially if your calculations are fairly linear.

The size of my buffer (or my buffers) will be constant and will
not be change during the running (i hope...) if that's what 
you mean. Please tell me a little about 'CreateFileMapping' 
and 'MapViewOfFile', How can it help me with my memory 
problem? (i used 'CreateFileMapping' in the past to create 
share memory between 2 applications but i don't know how to 
force it to create that memory on the real memory and not on
the hard-disk).


>>So How do i detect what is the largest size of buffer that i can
>>use that will not use the hard drive space? i guess that it can 
>>be change from one running to another depends on the amount of
>>memory which is in used at that moment.
>
>See VirtualQuerry and VirtualQuerryEx as well as GetSystemInfo
>and GetProcessWorkingSetSize

I'll check it thanks.

You gave me many methods here, and i'm realy confused now, 
let's say that YOU had to do that, in which of all this 
methods would you select? a short example code will help me a 
lot, not a detailed one, just a short template to show me the
sequence of the commands i need to do that.

Thanks very much!

Dani
Technical Details
Message-ID: <42abfa21$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42ab3793$1@newsgroups.borland.com> <gjmna117s71qnpihpbtg7sqmbbvaob90q6@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,93efc3d53d15c3e4
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Daniel" <DenielMail@Internet.com>
Sender: "Daniel" <DenielMail@Internet.com>
Reply-To: "Daniel" <DenielMail@Internet.com>
Subject: Re: How to Make Sure that Buffer use ONLY memory 
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 217.132.17.143     
References: <42ab3793$1@newsgroups.borland.com> <gjmna117s71qnpihpbtg7sqmbbvaob90q6@4ax.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42abfa21$1@newsgroups.borland.com>
Date: 12 Jun 2005 02:02:25 -0700
X-Trace: newsgroups.borland.com 1118566945 207.105.83.66 (12 Jun 2005 02:02:25 -0700)
Lines: 70
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail