Hmm... my mistake...
From: FU.U.NA (drawtree_at_hotmail.com)
Date: 03/31/04
- Next message: CV: "Windows Application Distribution"
- Previous message: Boris: "Printing "x" pages per ***"
- Next in thread: mburkhart: "RE: Hmm... my mistake..."
- Reply: mburkhart: "RE: Hmm... my mistake..."
- Messages sorted by: [ date ] [ thread ]
Date: 30 Mar 2004 21:46:52 -0800
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:<#0nu3jnFEHA.1228@TK2MSFTNGP11.phx.gbl>...
> 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" <drawtree@hotmail.com> wrote in message
> news:fed227b9.0403300044.646c8ca7@posting.google.com...
> > 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.
- Next message: CV: "Windows Application Distribution"
- Previous message: Boris: "Printing "x" pages per ***"
- Next in thread: mburkhart: "RE: Hmm... my mistake..."
- Reply: mburkhart: "RE: Hmm... my mistake..."
- Messages sorted by: [ date ] [ thread ]