PC Review


Reply
Thread Tools Rate Thread

How can I get memory allocated on PHYSICAL RAM and garanteed not on virtual ram.

 
 
FU.U.NA
Guest
Posts: n/a
 
      30th Mar 2004
Hi.

I simply want to allocate large size of memory (about 300~400 MB) on
just physical RAM (not on disc virtual ram).
I'm finding the garanteed method of allocating memory on PHYSICAL RAM.



DECRIPTION OF MY SITUATION:

I'm testing file copying with large memory cache.
As I know, disc reading and writing shows better performance when do
that at once. (sequal reading & writing)
And I think Windows Explorer copy routine does not use all memory that
they can use.
So I want to make my own routine that copying large file with large
cache.
(I have many large files have to be copied often between drives.)

To do that, I need large and fast speed cache to copy large byte
chunks.
And the cache never be on the virtual ram.

I don't know well about low level working of .NET FW and windows API.
So I want to find garanteed method of allocating memory on PHYSICAL
RAM.

Or, if you know about better way about fast copying of large file,
that's good also.




PS:
This is just test and private work, not a business job. Please don't
discuss about efficiency.
 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      30th Mar 2004
You are confused here. You want performance but you want to use the disk? In
addition, unless you are doing pretty low level stuff, RAM management is
outside of your control. The operating system is still free to swap out your
cached files to disk depending on resource pressure negating your efforts.
Unless you have deep experience, managing operating system resources should
not be your responsibility. I suggest you revisit your architecture so that
you have a better understanding of the process. If you feel you have a solid
understanding, you will have to use the win32 api thru managed as a solution
to your problem.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"FU.U.NA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi.
>
> I simply want to allocate large size of memory (about 300~400 MB) on
> just physical RAM (not on disc virtual ram).
> I'm finding the garanteed method of allocating memory on PHYSICAL RAM.
>
>
>
> DECRIPTION OF MY SITUATION:
>
> I'm testing file copying with large memory cache.
> As I know, disc reading and writing shows better performance when do
> that at once. (sequal reading & writing)
> And I think Windows Explorer copy routine does not use all memory that
> they can use.
> So I want to make my own routine that copying large file with large
> cache.
> (I have many large files have to be copied often between drives.)
>
> To do that, I need large and fast speed cache to copy large byte
> chunks.
> And the cache never be on the virtual ram.
>
> I don't know well about low level working of .NET FW and windows API.
> So I want to find garanteed method of allocating memory on PHYSICAL
> RAM.
>
> Or, if you know about better way about fast copying of large file,
> that's good also.
>
>
>
>
> PS:
> This is just test and private work, not a business job. Please don't
> discuss about efficiency.



 
Reply With Quote
 
FU.U.NA
Guest
Posts: n/a
 
      31st Mar 2004
I think you misunderstood my posting. And it caused by my mistake.
My plan was only making a program that copies large files from drive
into other drive as fast as possible.
The 'memory' I said was the 'buffer'.

This is code sample;

Stream srcFile sf = new FileStream ( ... );
Stream trgFile tf = new FileStream ( ... );

// 128 MB buffer. Very big buffer. This can consume all memory.
// But this always have to be placed on physical ram.
// Is there no managed way make this only on physical ram?
// or the wat to get current available physical ram size?
byte[] buffer = new byte [ 1024 * 1024 * 128 ];

// Read 128 MB at once.
int readCount = sf.Read ( buffer, 0, buffer.length );

// And write 128 MB at once.
tf.Write ( buffer, 0, readCount );


I understand you said as 'there is no managed way (excludes interop)
to get the garantee and you have to use WIN32 API to do that'.













"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:<#(E-Mail Removed)>...
> You are confused here. You want performance but you want to use the disk? In
> addition, unless you are doing pretty low level stuff, RAM management is
> outside of your control. The operating system is still free to swap out your
> cached files to disk depending on resource pressure negating your efforts.
> Unless you have deep experience, managing operating system resources should
> not be your responsibility. I suggest you revisit your architecture so that
> you have a better understanding of the process. If you feel you have a solid
> understanding, you will have to use the win32 api thru managed as a solution
> to your problem.
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/3he3b
> "FU.U.NA" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi.
> >
> > I simply want to allocate large size of memory (about 300~400 MB) on
> > just physical RAM (not on disc virtual ram).
> > I'm finding the garanteed method of allocating memory on PHYSICAL RAM.
> >
> >
> >
> > DECRIPTION OF MY SITUATION:
> >
> > I'm testing file copying with large memory cache.
> > As I know, disc reading and writing shows better performance when do
> > that at once. (sequal reading & writing)
> > And I think Windows Explorer copy routine does not use all memory that
> > they can use.
> > So I want to make my own routine that copying large file with large
> > cache.
> > (I have many large files have to be copied often between drives.)
> >
> > To do that, I need large and fast speed cache to copy large byte
> > chunks.
> > And the cache never be on the virtual ram.
> >
> > I don't know well about low level working of .NET FW and windows API.
> > So I want to find garanteed method of allocating memory on PHYSICAL
> > RAM.
> >
> > Or, if you know about better way about fast copying of large file,
> > that's good also.
> >
> >
> >
> >
> > PS:
> > This is just test and private work, not a business job. Please don't
> > discuss about efficiency.

 
Reply With Quote
 
=?Utf-8?B?bWJ1cmtoYXJ0?=
Guest
Posts: n/a
 
      1st Apr 2004
Have you considered using a RAM disk to facilitate the copy? i don't have a lot of experience with copying files quickly, but if you want to be sure to get physical memory, creating a RAM disk is one way to make sure you get it. Otherwise I guess you could just turn down your virtual memory settings in Windows, but that would probably case MORE swapping of other applications and data.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Physical vs. Virtual Memory Richard Fangnail Windows XP General 13 7th Jul 2009 07:26 AM
virtual/physical memory?... =?Utf-8?B?Um9iTGVl?= Windows XP Basics 6 10th Nov 2004 09:13 PM
virtual Memory / allocated memory Victor Microsoft Windows 2000 Terminal Server Applications 1 4th Jun 2004 10:27 PM
physical memory dump / virtual memory Jennifer Stewart Microsoft Windows 2000 0 5th Feb 2004 09:49 PM
Low virtual/physical memory Claire Onyimba Windows XP Hardware 1 1st Oct 2003 04:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:30 PM.