BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do i make sure Buffer is ONLY in memory?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++)
View previous topic :: View next topic  
Author Message
Daniel
Guest





PostPosted: Sat Jun 11, 2005 6:21 pm    Post subject: How do i make sure Buffer is ONLY in memory? Reply with quote




Hello,

While running i need to create a buffer that will hold data, and
i need to do lot of calculations on this buffer, i need it to be
as fast as possible, and i need that the buffer will also be as
large as possible to hold as much data as it possibly can.

Now the problem is this, as i understand if i declare on a very
large buffer and fills if with data, like this for example -

double *HugeBuffer = new double[0xFFFFFFFFFFFFFFFFFFFFFF];

Fills HugeBuffer[] with data from file...

then becouse the PC doesn't have so much memory it will use part
of the Hard-Drive to hold this buffer data, but that will slow
down my calculations right? so i want to make sure that all the
data in my application while running is presents ONLY in the PC
real memory and not on the hard disk, i don't want the program
to waste time approaching the hard disk reading and writing data
to the buffer.

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.

Thanks,

Dani.

Back to top
Liz Albin
Guest





PostPosted: Sat Jun 11, 2005 6:43 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote



On 11 Jun 2005 11:21:00 -0700, Daniel wrote:

Quote:
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.

I believe that this question is more appropriate to the nativeapi group.
Meanwhile, check out memory allocation and virtual memory functions in the
Win32 SDK developer's reference help.

VirtualAlloc() VirtualLock() etc may be of help to you
--
Good luck,

liz

Back to top
Daniel
Guest





PostPosted: Sat Jun 11, 2005 7:10 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote




Thanks, i'll ask it again in nativeapi group.

SDK, does it means that i have to download (for free?) and
install new components to my builder?

Dani.


Liz Albin <lizalbin (AT) yahooNotThis (DOT) com> wrote:
Quote:
On 11 Jun 2005 11:21:00 -0700, Daniel wrote:

I believe that this question is more appropriate to the nativeapi group.
Meanwhile, check out memory allocation and virtual memory functions in the
Win32 SDK developer's reference help.

VirtualAlloc() VirtualLock() etc may be of help to you
--
Good luck,

liz


Back to top
Liz Albin
Guest





PostPosted: Sat Jun 11, 2005 7:41 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote

On 11 Jun 2005 12:10:20 -0700, Daniel wrote:

Quote:
Thanks, i'll ask it again in nativeapi group.

SDK, does it means that i have to download (for free?) and
install new components to my builder?

Dani.

No, that's part of your Windows installation Smile
--
Good luck,

liz

Back to top
Ed Mulroy
Guest





PostPosted: Sat Jun 11, 2005 7:54 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote

Quote:
SDK, does it means that i have to download (for free?) and
install new components to my builder?

It means you have to read the Windows help file that came with the compiler
and use the functions that do what you want.

.. Ed

Quote:
Daniel wrote in message
news:42ab371c$1 (AT) newsgroups (DOT) borland.com...

Thanks, i'll ask it again in nativeapi group.

SDK, does it means that i have to download (for free?) and
install new components to my builder?



Back to top
Daniel
Guest





PostPosted: Sat Jun 11, 2005 9:00 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote


Thanks Liz, do you know if this command works on Windows-xp ?

See a reply of TeamB member on this subject -

Quote:
Is there a way to allocate 'real' memory?

Yes. Write a kernel-mode device driver. That's the only way to
get "real" memory in Win32.

Alternatively look at VirtualLock - but that is only
implemented as a stub on Windows PlayStation (Win9x) and does
not *guarantee* memory locking on Windows NT (AFAIR).

============

and how do i write a kernel-mode device driver?

Thanks,

Dani.


Liz Albin <lizalbin (AT) yahooNotThis (DOT) com> wrote:
Quote:
On 11 Jun 2005 12:10:20 -0700, Daniel wrote:

Thanks, i'll ask it again in nativeapi group.

SDK, does it means that i have to download (for free?) and
install new components to my builder?

Dani.

No, that's part of your Windows installation Smile
--
Good luck,

liz


Back to top
Deniel
Guest





PostPosted: Sat Jun 11, 2005 9:01 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote


Thanks.


"Ed Mulroy" <dont_email_me (AT) bitbuc (DOT) ket> wrote:
Quote:
SDK, does it means that i have to download (for free?) and
install new components to my builder?

It means you have to read the Windows help file that came with the compiler
and use the functions that do what you want.

. Ed


Back to top
Rudy Velthuis [TeamB]
Guest





PostPosted: Sun Jun 12, 2005 8:06 am    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote

At 23:00:05, 11.06.2005, Daniel wrote:

Quote:
Alternatively look at VirtualLock - but that is only
implemented as a stub on Windows PlayStation (Win9x) and does
not guarantee memory locking on Windows NT (AFAIR).

Was that TeamB member called Stefan or Peter? <g>

--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"We don't make mistakes, we just have happy little accidents."
-- Bob Ross, "The Joy of Painting"

Back to top
Deniel
Guest





PostPosted: Sun Jun 12, 2005 7:03 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote


Actually no, here is the original message that i found very
quickly by using google newsgroups search -

TeamB Jul 6 1999, 3:00 am

Newsgroups: borland.public.cppbuilder.winapi
From: Stefan.Hoffmeis... (AT) Econos (DOT) de (Stefan Hoffmeister (TeamB)) - Find messages by this author
Date: 1999/07/06
Subject: Re: Avoiding Windows memory paging
Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse

: "Boaz Sommer" <Boaz.Som... (AT) dspis (DOT) co.il> wrote:

Quote:
Is there a way to allocate 'real' memory?

Yes. Write a kernel-mode device driver. That's the only way to get "real"
memory in Win32.

Alternatively look at VirtualLock - but that is only implemented as a stub
on Windows PlayStation (Win9x) and does not *guarantee* memory locking on
Windows NT (AFAIR).

--
Stefan Hoffmeister (TeamB) http://www.econos.de/
Please do apply judgement when sending email.


Quote:
Was that TeamB member called Stefan or Peter?
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"We don't make mistakes, we just have happy little accidents."
-- Bob Ross, "The Joy of Painting"


Back to top
Rudy Velthuis [TeamB]
Guest





PostPosted: Sun Jun 12, 2005 7:53 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote

At 21:03:49, 12.06.2005, Deniel wrote:

Quote:

Actually no, here is the original message

I was right, it was Stefan. <g>
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"If the automobile had followed the same development cycle as the
computer, a Rolls-Royce would today cost $100, get a million miles
per gallon, and explode once a year, killing everyone inside."
-- Robert X. Cringely.

Back to top
Deniel
Guest





PostPosted: Sun Jun 12, 2005 8:37 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote


Ooooops Sorry, you where right after all...

What is this <g> sign? what does it means?

Dani.


"Rudy Velthuis [TeamB]" <velthuis (AT) gmail (DOT) com> wrote:
Quote:
At 21:03:49, 12.06.2005, Deniel wrote:


Actually no, here is the original message

I was right, it was Stefan. --
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"If the automobile had followed the same development cycle as the
computer, a Rolls-Royce would today cost $100, get a million miles
per gallon, and explode once a year, killing everyone inside."
-- Robert X. Cringely.


Back to top
Rudy Velthuis [TeamB]
Guest





PostPosted: Sun Jun 12, 2005 8:48 pm    Post subject: Re: How do i make sure Buffer is ONLY in memory? Reply with quote

At 22:37:56, 12.06.2005, Deniel wrote:

Quote:

Ooooops Sorry, you where right after all...

What is this <g> sign? what does it means?

Short for <grin> or <grinning>. An older way to denote a smiley.
--
Rudy Velthuis [TeamB] http://velthuis.homepage.t-online.de

"Friends applaud, the Comedy is over." - Ludwig von Beethoven, dying words

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.