memory-mapped-files

Expanding Java Memory-Mapped Byte Buffer

Greetings All, Is there a way to expand the Java memory-mapped byte buffer such that the new size is reflected back to the mapped file on disk ? Thank you ! ...

access memory mapped file created on .net via python

I made a memory mapped file using MemoryMappedFile.CreateNew(mapName, capacity) of .net 4 Can i access this mmf by the mapName from cpython ? I tried like below. import mmap map = mmap.mmap(-1, 0, mapName, 1) but it returns WindowsError [error 87] saying the parameter is incorrect. I'm using windows vista. ...

Is the data in a memory-mapped file guaranteed to flush sequentially?

I'm trying to implement a file storage mechanism which holds a number of variably-sized records in a single file with the guarantee that the set of records will always be recoverable into a consistent state, even if the system failed at a hardware level. So far, every scheme I've come up with pivots on writing data sequentially. Some pi...

Very big QImage and Memory Mapped Files in QT

I want bind QImage to the MMF file to manipulate the image without the cost of memory directly on the disc. Unfortunately, my code creates a copy in memory. QFile file("Boston City Flow.jpg"); if(!file.open(QIODevice::ReadOnly)) QMessageBox::information(this, "Error", "Error"); qint64 size = file.size(); unsigned char *mmf = fil...

Is there really no mremap in Darwin?

I'm trying to find out how to remap memory-mapped files on a Mac (when I want to expand the available space). I see our friends in the Linux world have mremap but I can find no such function in the headers on my Mac. /Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/mman.h has the following: mmap mprotect msync munlock munmap but no mre...

How do I create a memory-mapped file without a backing file on OSX?

I want to use a library that uses file descriptors as the basic means to access its data. For performance reasons, I don't want to have to commit files to the disk each before I use this library's functions. I want to create (large) data blobs on the fly, and call into the library to send them to a server. As it stands, I have to write ...

Android memory mapped file with vertices

I am trying to render vertices stored in a big file (approx 50Mb). The file layout is optimized so i can take a slice and give it to opengl to render a triangel strip directly. This works in the emulator, but when I run the same code in my magic (android 1.5) it crashes with a SIGBUS in libhgl.so. Sounds like a driver issue? I have tr...

Performance of Win32 memory mapped files vs. CRT fopen/fread

I need to read (scan) a file sequentially and process its content. File size can be anything from very small (some KB) to very large (some GB). I tried two techniques using VC10/VS2010 on Windows 7 64-bit: Win32 memory mapped files (i.e. CreateFile, CreateFileMapping, MapViewOfFile, etc.) fopen and fread from CRT. I thought that mem...

System Error 0x5: CreateFileMapping()

I wish to implement IPC using Named Shared Memory. To do this, one of the steps is getting a handle to a Mapping Memory Object, using CreateFileMapping(). I do it exactly as MSDN website reccommends: http://msdn.microsoft.com/en-us/library/aa366551(v=VS.85).aspx: hFileMappingHandle = CreateFileMapping ( INVALID_HANDLE_VA...

Fastest way to deserialize objects from huge binary file

So the scenario is as follows: I have a 2-3 gb large files of binary serialized objects, I also have an index file which contains the id of each object and their offset in the file. I need to write a method that given a set of id's deserializes them into memory. Performance is the most important benchmark and keeping the memory requir...

How do I check for an error after [NSData dataWithContentsOfMappedFile:]?

I have this code in my project: id mappedData = [dataWithContentsOfMappedFile: path] Obviously, if mappedData is nil it didn't succeed. But how can I get details about why it didn't succeed? There's no dataWithContentsOfMappedFile:withError:. ...