|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RAM DriveI 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. "Steverino" <Stever***@discussions.microsoft.com> wrote in message You can't make a RAM drive in VB, you need C++ or similar. But why do you 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. 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 "Steverino" <Stever***@discussions.microsoft.com> wrote in message news:55FC3B53-0D04-496C-AF89-CF4FA8DFF456@microsoft.com... 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.>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. Why do you THINK you need a RAM drive for this? -- Mike 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. -- Show quoteHide quoteRegards, 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 > > I know of NO reason that would justify stealing RAM that Windows and your applications could use.
-- Show quoteHide quoteMike "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 >> >> > > Rick Raisley wrote:
> There are lots of reasons for a RAM drive. One of the best is for Windows or That just makes no damned sense. If you have enough memory for a swapfile to go > 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! ;-) 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... "Karl E. Peterson" <k***@exmvps.org> wrote If you have an array of User Defined Types that is in excess of 2 gigs, (ex 4-6 gigs)> > 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! 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
Show quote
Hide quote
"Larry Serflaten" <serfla***@usinternet.com> schrieb im Newsbeitrag No... <g> since we are working in a 32Bit-process.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? > Particularly, sorting that large of an array would normally need You can solve that problem over the already mentioned> 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.... 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
Show quote
Hide quote
"Schmidt" <s**@online.de> wrote in message Yep. I wrote about that some nine years ago: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. > http://vb.mvps.org/articles/bb200007.asp "Schmidt" <s**@online.de> wrote You've lost me, what was the problem you were trying to solve?> 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. 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
Show quote
Hide quote
"Larry Serflaten" <serfla***@usinternet.com> schrieb im Newsbeitrag A RamDrive needs Ram - if you don't define a Ram-Drive,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? 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 Larry Serflaten wrote:
Show quoteHide quote > "Karl E. Peterson" <k***@exmvps.org> wrote I mentioned "exceptions"? The one Olaf mentioned -- MMFs -- was what I had in mind. >> > 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.... 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. :-) "Karl E. Peterson" <k***@exmvps.org> wrote I was thinking more of the case where you had RAM, but couldn't access it> > 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. :-) due to the 2 gig limitation. None the less, its not something I'd likely encounter.... LFS Larry Serflaten wrote:
> "Karl E. Peterson" <k***@exmvps.org> wrote I haven't actually run into it, either. I'd still be interested in hearing of an > >> > 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.... actual scenario where this might work out. 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. -- Show quoteHide quoteRegards, 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 > 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 >> > > 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. ;-) -- Show quoteHide quoteRegards, Rick Raisley heavymetal-A-T-bellsouth-D-O-T-net "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 >>> >> >> > Rick Raisley wrote:
> ... I was simply Prices are dropping on fast SSDs, which pretty much remove the last> 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. ;-) 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.
Bwahahahaha. Clever stuff you have there. <g>
Kevin Provance wrote:
>> Twisted tees at http://www.cafepress.com/2050inc Spead the word... (-:> > Bwahahahaha. Clever stuff you have there. <g>
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. > |
|||||||||||||||||||||||