Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

MappedBuffer Failed To Opening a Giant File

Moderators: larsivi kris

Posted: 03/04/08 07:46:23

I want to process my file that has size more than 600MB with tango.io.MappedBuffer?. However, it failed with message: “Not enough storage is available to process this command.

As long as what I know, MappedBuffer? used File Mapping method that generally used to processing a giant file, without need to map it entire content straight into the computer memory (fix me if I am wrong).

Is this my fault or it was the liability of MappedBuffer?, or tango? Any idea to fix my problems would appreciated =), or am I must created my own function indeed?

Sorry for my bad English =(

Author Message

Posted: 03/04/08 18:09:45

I'll take a look, yfktn. Thanks!

Posted: 03/05/08 01:11:04

Thanks Kris, I think the problems are in the line of 171 to 172 …

171 void[] mem = base [0 .. cast(int) size];
172 setContent (mem);

It seems if the code just set entire content of my big and ugly file straight into the buffer. Isn't it better if MappedBuffer? doing some advance step? Maybe it does not map the entire file straight into the memory first, but we do it part by part of the file.

I think you know it better than I do =) (it is hard to explain in English =( )

It must be fun if you fix it, because I want to develop application that able to transferring my big file across the LAN using tango as it library. Temporary it seems if I should try to adapt phobos lib in std.mmfile into tango, or installing tangobos.

Posted: 03/05/08 04:11:09

You will probably have the same issue with phobos? I suspect that your page-file (swap space) is not large enough or something? I've used this with files over 1GB in size, myself.

BTW: the lines you noted is assigning virtual-memory to an array - not real memory - it is mapped onto the file and paged-in on an as-needed basis.

Posted: 03/05/08 06:39:31

Ok Kris, I will check my page-file too, the problem is perhaps in my computer as what you told me so. Moreover, you are right, it even no Exception message when I used mmfile of Phobos. Beside that, I will try my program in the other computer.

Thanks for your quick response, awesome :)

Posted: 03/05/08 22:43:13

you are welcome! :)