Home All Groups Group Topic Archive Search About
Author
12 Jun 2009 4:54 PM
Steverino
I found how to set a virtual drive in VB6, but what I really need is a RAM
drive.
How do I create a RAM drive?
Does not need to be very big, maybe 10MBytes or so.
Need to be able to save a file there and have an app on another drive open it.

Author
12 Jun 2009 5:19 PM
Nobody
"Steverino" <Stever***@discussions.microsoft.com> wrote in message
news:55FC3B53-0D04-496C-AF89-CF4FA8DFF456@microsoft.com...
>I found how to set a virtual drive in VB6, but what I really need is a RAM
> drive.
> How do I create a RAM drive?
> Does not need to be very big, maybe 10MBytes or so.
> Need to be able to save a file there and have an app on another drive open
> it.

You can't make a RAM drive in VB, you need C++ or similar. But why do you
need to do this? If it's for two apps to communicate, use WM_COPYDATA, which
is faster.

How To Pass String Data Between Applications Using SendMessage
http://support.microsoft.com/kb/176058

More methods:

INFO: Interprocess Communication on Windows Platforms
http://support.microsoft.com/kb/95900
Are all your drivers up to date? click for free checkup

Author
12 Jun 2009 5:25 PM
MikeD
"Steverino" <Stever***@discussions.microsoft.com> wrote in message news:55FC3B53-0D04-496C-AF89-CF4FA8DFF456@microsoft.com...
>I found how to set a virtual drive in VB6, but what I really need is a RAM
> drive.
> How do I create a RAM drive?
> Does not need to be very big, maybe 10MBytes or so.
> Need to be able to save a file there and have an app on another drive open it.

Jump into your time machine and go back about 15 years or so.  As far as I know, RAM drives pretty much died with DOS.

Why do you THINK you need a RAM drive for this?

--
Mike
Author
12 Jun 2009 8:24 PM
Rick Raisley
There are lots of reasons for a RAM drive. One of the best is for Windows or
application Temp files, or if you have enough memory, even swap files. This
speeds up operation a LOT, prevents fragmentation (as they're reconstructed
each time Windows is started), and oh yeah, they're FAST!  ;-)

CAD applications can really benefit from such a RAM drive. So far we've not
had enough memory to really utilize it, but those that do really see the
benefits.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net

Show quoteHide quote
"MikeD" <nob***@nowhere.edu> wrote in message
news:Oq3PXL46JHA.5180@TK2MSFTNGP04.phx.gbl...
>
> "Steverino" <Stever***@discussions.microsoft.com> wrote in message
> news:55FC3B53-0D04-496C-AF89-CF4FA8DFF456@microsoft.com...
>>I found how to set a virtual drive in VB6, but what I really need is a RAM
>> drive.
>> How do I create a RAM drive?
>> Does not need to be very big, maybe 10MBytes or so.
>> Need to be able to save a file there and have an app on another drive
>> open it.
>
> Jump into your time machine and go back about 15 years or so.  As far as I
> know, RAM drives pretty much died with DOS.
>
> Why do you THINK you need a RAM drive for this?
>
> --
> Mike
>
>
Author
12 Jun 2009 8:38 PM
MikeD
I know of NO reason that would justify stealing RAM that Windows and your applications could use.


--
Mike




Show quoteHide quote
"Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message news:ee1h7u56JHA.1416@TK2MSFTNGP04.phx.gbl...
> There are lots of reasons for a RAM drive. One of the best is for Windows or application Temp files, or if you have enough memory,
> even swap files. This speeds up operation a LOT, prevents fragmentation (as they're reconstructed each time Windows is started),
> and oh yeah, they're FAST!  ;-)
>
> CAD applications can really benefit from such a RAM drive. So far we've not had enough memory to really utilize it, but those that
> do really see the benefits.
>
> --
> Regards,
>
> Rick Raisley
> heavymetal-A-T-bellsouth-D-O-T-net
>
> "MikeD" <nob***@nowhere.edu> wrote in message news:Oq3PXL46JHA.5180@TK2MSFTNGP04.phx.gbl...
>>
>> "Steverino" <Stever***@discussions.microsoft.com> wrote in message news:55FC3B53-0D04-496C-AF89-CF4FA8DFF456@microsoft.com...
>>>I found how to set a virtual drive in VB6, but what I really need is a RAM
>>> drive.
>>> How do I create a RAM drive?
>>> Does not need to be very big, maybe 10MBytes or so.
>>> Need to be able to save a file there and have an app on another drive open it.
>>
>> Jump into your time machine and go back about 15 years or so.  As far as I know, RAM drives pretty much died with DOS.
>>
>> Why do you THINK you need a RAM drive for this?
>>
>> --
>> Mike
>>
>>
>
>
Author
13 Jun 2009 12:10 AM
Karl E. Peterson
Rick Raisley wrote:
> There are lots of reasons for a RAM drive. One of the best is for Windows or
> application Temp files, or if you have enough memory, even swap files. This
> speeds up operation a LOT, prevents fragmentation (as they're reconstructed
> each time Windows is started), and oh yeah, they're FAST!  ;-)

That just makes no damned sense.  If you have enough memory for a swapfile to go
into memory, why do you need a swapfile?  I mean, think about it!  Those are used,
almost exclusively, for times when you're *out* of memory.  (I know there are
exceptions, but they're pretty rare.)

Temp files, yeah, okay, maybe.  Swapfile?  Hmmmmm...
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
13 Jun 2009 2:02 AM
Larry Serflaten
"Karl E. Peterson" <k***@exmvps.org> wrote
> > There are lots of reasons for a RAM drive. One of the best is for Windows or
> > application Temp files, or if you have enough memory, even swap files.

> That just makes no damned sense.  If you have enough memory for a swapfile to go
> into memory, why do you need a swapfile?  I mean, think about it!

If you have an array of User Defined Types that is in excess of 2 gigs, (ex 4-6 gigs)
you can't keep that all "in memory", can you?  Particularly, sorting that large of an
array would normally need to consider memory usage (paging) as part of the
algorithm selection process (eg a quicksort might be good if it all fits in RAM,
but not so good if paging is required).

With a RAM Disk swap file, that might not be so much of a concern....

LFS
Author
13 Jun 2009 5:39 AM
Schmidt
Show quote Hide quote
"Larry Serflaten" <serfla***@usinternet.com> schrieb im Newsbeitrag
news:Ou8Y1q86JHA.1764@TK2MSFTNGP06.phx.gbl...
>
> "Karl E. Peterson" <k***@exmvps.org> wrote
> > > There are lots of reasons for a RAM drive. One of the
> > > best is for Windows or application Temp files, or if you
> > > have enough memory, even swap files.
>
> > That just makes no damned sense.  If you have enough memory
> > for a swapfile to go into memory, why do you need a swapfile?
> > I mean, think about it!
>
> If you have an array of User Defined Types that is in excess
> of 2 gigs, (ex 4-6 gigs) you can't keep that all "in memory",
> can you?
No... <g> since we are working in a 32Bit-process.

> Particularly, sorting that large of an array would normally need
> to consider memory usage (paging) as part of the algorithm
> selection process (eg a quicksort might be good if it all fits in
>  RAM, but not so good if paging is required).
>
> With a RAM Disk swap file, that might not be so much of a concern....

You can solve that problem over the already mentioned
SwapFile (which usually resides InMemory).

CreateFileMapping(INVALID_HANDLE_VALUE,...,...
which will create the Mapping on the paging file

followed by MapViewOfFile,
which returns a pointer, that you could bind to an
array dynamically over the safeArray-Header.

Olaf
Author
13 Jun 2009 6:26 AM
Bill McCarthy
Show quote Hide quote
"Schmidt" <s**@online.de> wrote in message
news:eeNowr%236JHA.1564@TK2MSFTNGP06.phx.gbl...
>>
>> With a RAM Disk swap file, that might not be so much of a concern....
>
> You can solve that problem over the already mentioned
> SwapFile (which usually resides InMemory).
>
> CreateFileMapping(INVALID_HANDLE_VALUE,...,...
> which will create the Mapping on the paging file
>
> followed by MapViewOfFile,
> which returns a pointer, that you could bind to an
> array dynamically over the safeArray-Header.
>

Yep.  I wrote about that some nine years ago:
http://vb.mvps.org/articles/bb200007.asp
Author
13 Jun 2009 12:20 PM
Larry Serflaten
"Schmidt" <s**@online.de> wrote
> You can solve that problem over the already mentioned
> SwapFile (which usually resides InMemory).
>
> CreateFileMapping(INVALID_HANDLE_VALUE,...,...
> which will create the Mapping on the paging file
>
> followed by MapViewOfFile,
> which returns a pointer, that you could bind to an
> array dynamically over the safeArray-Header.


You've lost me, what was the problem you were trying to solve?

Mapping a file still requires disk access, does it not?  The point
with a RAM Disk is that such accesses go blazingly fast compared
to the spinning disk access times.  IOW, a big performance boost
if disk access is required when you can direct that access to the RAM
drive.

LFS
Author
13 Jun 2009 12:48 PM
Schmidt
Show quote Hide quote
"Larry Serflaten" <serfla***@usinternet.com> schrieb im Newsbeitrag
news:OWhUcEC7JHA.4864@TK2MSFTNGP03.phx.gbl...
>
> "Schmidt" <s**@online.de> wrote
> > You can solve that problem over the already mentioned
> > SwapFile (which usually resides InMemory).
> >
> > CreateFileMapping(INVALID_HANDLE_VALUE,...,...
> > which will create the Mapping on the paging file
> >
> > followed by MapViewOfFile,
> > which returns a pointer, that you could bind to an
> > array dynamically over the safeArray-Header.
>
>
> You've lost me, what was the problem you were trying to solve?
A RamDrive needs Ram - if you don't define a Ram-Drive,
you have that Ram available in your System of course.

If you now call:
CreateFileMapping(INVALID_HANDLE_VALUE
The System will create that "File" in the paging-area -
(which indirectly would then swap automatically into
the SwapFile, should the requested Size not entirely
fit into the yet availabale Ram - which is larger now of
course, since you avoided the Ram-Drive ;-)

> Mapping a file still requires disk access, does it not?
No, not in the case above - just google for memory-
mapped files and note the Constant:
INVALID_HANDLE_VALUE

Disk-access only comes into the game here, if the system
runs out of memory (and begins to swap - due to other
applications - or if you requested a size, that does not
fit into the available Ram).

The nice thing with the approach above is, that it will
allow you even larger areas than your Ram-Drive-
approach, since with a Ram-Drive you are limited
to: RamDriveSize = AvailableRam - 256_or_512MB
or even more preserved Ram for the System (in case
we talk about Vista, then better reserve 1GB).

The MemoryMapped-File-approach will automatically
swap in case you wanted a bit too much - but it also
works "intelligently" into the other direction, that only
these areas you currently address (and fill) whilst
working with your Array against the MapPtr, are
"physically requested" from the pager - but all that
without any disk-access - sheer memory-Performance
(as long as you work within the same size you'd have
specified for your Ram-Drive on the same system too).


Olaf
Author
15 Jun 2009 9:24 PM
Karl E. Peterson
Larry Serflaten wrote:
Show quoteHide quote
> "Karl E. Peterson" <k***@exmvps.org> wrote
>> > There are lots of reasons for a RAM drive. One of the best is for Windows or
>> > application Temp files, or if you have enough memory, even swap files.
>
>> That just makes no damned sense.  If you have enough memory for a swapfile to go
>> into memory, why do you need a swapfile?  I mean, think about it!
>
> If you have an array of User Defined Types that is in excess of 2 gigs, (ex 4-6
> gigs) you can't keep that all "in memory", can you?  Particularly, sorting that
> large of an array would normally need to consider memory usage (paging) as part of
> the
> algorithm selection process (eg a quicksort might be good if it all fits in RAM,
> but not so good if paging is required).
>
> With a RAM Disk swap file, that might not be so much of a concern....

I mentioned "exceptions"?  The one Olaf mentioned -- MMFs -- was what I had in mind.
Those can be created within the swapfile, which if you're not out of memory is *in*
memory.  Makes no sense to set aside RAM because you don't have enough RAM.  Classic
nose-spite-face scenario, there.  :-)
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
16 Jun 2009 12:00 AM
Larry Serflaten
"Karl E. Peterson" <k***@exmvps.org> wrote

> > With a RAM Disk swap file, that might not be so much of a concern....
>
> I mentioned "exceptions"?  The one Olaf mentioned -- MMFs -- was what I had in mind.
> Those can be created within the swapfile, which if you're not out of memory is *in*
> memory.  Makes no sense to set aside RAM because you don't have enough RAM.  Classic
> nose-spite-face scenario, there.  :-)

I was thinking more of the case where you had RAM, but couldn't access it
due to the 2 gig limitation.

None the less, its not something I'd likely encounter....

LFS
Author
16 Jun 2009 12:08 AM
Karl E. Peterson
Larry Serflaten wrote:
> "Karl E. Peterson" <k***@exmvps.org> wrote
>
>> > With a RAM Disk swap file, that might not be so much of a concern....
>>
>> I mentioned "exceptions"?  The one Olaf mentioned -- MMFs -- was what I had in
>> mind. Those can be created within the swapfile, which if you're not out of memory
>> is *in* memory.  Makes no sense to set aside RAM because you don't have enough
>> RAM.  Classic nose-spite-face scenario, there.  :-)
>
> I was thinking more of the case where you had RAM, but couldn't access it
> due to the 2 gig limitation.
>
> None the less, its not something I'd likely encounter....

I haven't actually run into it, either.  I'd still be interested in hearing of an
actual scenario where this might work out.
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
23 Jun 2009 11:58 AM
Rick Raisley
Okay, then, Temp files. We have CAD machines with 8-16 GB of memory. The
applications, and Windows, only use so much of that memory, and don't need
more. However, regardless of the amount of memory you have, Windows and many
applications use what /I/ call swap files, but may be more Temp files. They
place memory temporarily on a hard drive, even if RAM memory is available
for it. Doing that takes time, and a RAM drives reduces the time greatly.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net

Show quoteHide quote
"Karl E. Peterson" <k***@exmvps.org> wrote in message
news:uScBpt76JHA.728@TK2MSFTNGP05.phx.gbl...
> Rick Raisley wrote:
>> There are lots of reasons for a RAM drive. One of the best is for Windows
>> or
>> application Temp files, or if you have enough memory, even swap files.
>> This
>> speeds up operation a LOT, prevents fragmentation (as they're
>> reconstructed
>> each time Windows is started), and oh yeah, they're FAST!  ;-)
>
> That just makes no damned sense.  If you have enough memory for a swapfile
> to go into memory, why do you need a swapfile?  I mean, think about it!
> Those are used, almost exclusively, for times when you're *out* of memory.
> (I know there are exceptions, but they're pretty rare.)
>
> Temp files, yeah, okay, maybe.  Swapfile?  Hmmmmm...
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>
Author
23 Jun 2009 12:34 PM
Bill McCarthy
Hi Rick,

Over the 3 GB mark of RAM or so you need to be running a 64 bit version of
Windows, and your application also needs to be a 64 bit compiled
application.  VB6 is incapable of that.  VB.NET does compile to 64 bit.



Show quoteHide quote
"Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message
news:%23fERyn$8JHA.3836@TK2MSFTNGP02.phx.gbl...
> Okay, then, Temp files. We have CAD machines with 8-16 GB of memory. The
> applications, and Windows, only use so much of that memory, and don't need
> more. However, regardless of the amount of memory you have, Windows and
> many applications use what /I/ call swap files, but may be more Temp
> files. They place memory temporarily on a hard drive, even if RAM memory
> is available for it. Doing that takes time, and a RAM drives reduces the
> time greatly.
>
> --
> Regards,
>
> Rick Raisley
> heavymetal-A-T-bellsouth-D-O-T-net
>
> "Karl E. Peterson" <k***@exmvps.org> wrote in message
> news:uScBpt76JHA.728@TK2MSFTNGP05.phx.gbl...
>> Rick Raisley wrote:
>>> There are lots of reasons for a RAM drive. One of the best is for
>>> Windows or
>>> application Temp files, or if you have enough memory, even swap files.
>>> This
>>> speeds up operation a LOT, prevents fragmentation (as they're
>>> reconstructed
>>> each time Windows is started), and oh yeah, they're FAST!  ;-)
>>
>> That just makes no damned sense.  If you have enough memory for a
>> swapfile to go into memory, why do you need a swapfile?  I mean, think
>> about it! Those are used, almost exclusively, for times when you're *out*
>> of memory. (I know there are exceptions, but they're pretty rare.)
>>
>> Temp files, yeah, okay, maybe.  Swapfile?  Hmmmmm...
>> --
>> .NET: It's About Trust!
>> http://vfred.mvps.org
>>
>
>
Author
23 Jun 2009 1:49 PM
Rick Raisley
Well, I don't disagree with that. We use 64-bit XP and CAD applications, and
yes VB6 does have that limitation. I was simply commenting on the
usefulness, even though we are out of the DOS age, of RAM drives. Used
properly, they can be a tremendous boost to system/program performance. But
they're probably not for everyone.  ;-)

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net

Show quoteHide quote
"Bill McCarthy" <TPASoft.com Are Identity Thieves> wrote in message
news:Orb2P8$8JHA.2120@TK2MSFTNGP02.phx.gbl...
> Hi Rick,
>
> Over the 3 GB mark of RAM or so you need to be running a 64 bit version of
> Windows, and your application also needs to be a 64 bit compiled
> application.  VB6 is incapable of that.  VB.NET does compile to 64 bit.
>
>
>
> "Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message
> news:%23fERyn$8JHA.3836@TK2MSFTNGP02.phx.gbl...
>> Okay, then, Temp files. We have CAD machines with 8-16 GB of memory. The
>> applications, and Windows, only use so much of that memory, and don't
>> need more. However, regardless of the amount of memory you have, Windows
>> and many applications use what /I/ call swap files, but may be more Temp
>> files. They place memory temporarily on a hard drive, even if RAM memory
>> is available for it. Doing that takes time, and a RAM drives reduces the
>> time greatly.
>>
>> --
>> Regards,
>>
>> Rick Raisley
>> heavymetal-A-T-bellsouth-D-O-T-net
>>
>> "Karl E. Peterson" <k***@exmvps.org> wrote in message
>> news:uScBpt76JHA.728@TK2MSFTNGP05.phx.gbl...
>>> Rick Raisley wrote:
>>>> There are lots of reasons for a RAM drive. One of the best is for
>>>> Windows or
>>>> application Temp files, or if you have enough memory, even swap files.
>>>> This
>>>> speeds up operation a LOT, prevents fragmentation (as they're
>>>> reconstructed
>>>> each time Windows is started), and oh yeah, they're FAST!  ;-)
>>>
>>> That just makes no damned sense.  If you have enough memory for a
>>> swapfile to go into memory, why do you need a swapfile?  I mean, think
>>> about it! Those are used, almost exclusively, for times when you're
>>> *out* of memory. (I know there are exceptions, but they're pretty rare.)
>>>
>>> Temp files, yeah, okay, maybe.  Swapfile?  Hmmmmm...
>>> --
>>> .NET: It's About Trust!
>>> http://vfred.mvps.org
>>>
>>
>>
>
Author
23 Jun 2009 3:18 PM
Jim Mack
Rick Raisley wrote:
> ...     I was simply
> commenting on the usefulness, even though we are out of the DOS
> age, of RAM drives. Used properly, they can be a tremendous boost
> to system/program performance. But they're probably not for
> everyone.  ;-)

Prices are dropping on fast SSDs, which pretty much remove the last
need for RAM drives. Some of these are rated at 200MB/s read and
write, even better in Raid-0. And the big performance killer, seek
time, is essentially zero (100 uSec).

Mtron, Corsair, Samsung, Intel and others offer small SSDs that are
great for this: put your system (boot), pagefile and temp directory on
Raid-0 pair of small (say 16GB) drives, and the rest of your data on a
big SATA-3 raid pair. You won't believe how much more responsive
Windows seems.

--
   Jim Mack
   Twisted tees at http://www.cafepress.com/2050inc
   "We sew confusion"
Author
23 Jun 2009 4:34 PM
Kevin Provance
|   Twisted tees at http://www.cafepress.com/2050inc

Bwahahahaha.  Clever stuff you have there.  <g>
Author
23 Jun 2009 7:26 PM
Jim Mack
Kevin Provance wrote:
>>   Twisted tees at http://www.cafepress.com/2050inc
>
> Bwahahahaha.  Clever stuff you have there.  <g>

Spead the word... (-:
Author
12 Jun 2009 8:07 PM
jaf
http://www.mydigitallife.info/2007/05/27/free-ramdisk-for-windows-vista-xp-2000-and-2003-server/


John


Show quoteHide quote
"Steverino" <Stever***@discussions.microsoft.com> wrote in message news:55FC3B53-0D04-496C-AF89-CF4FA8DFF456@microsoft.com...
>I found how to set a virtual drive in VB6, but what I really need is a RAM
> drive.
> How do I create a RAM drive?
> Does not need to be very big, maybe 10MBytes or so.
> Need to be able to save a file there and have an app on another drive open it.
>

Bookmark and Share