Problem 861. Memory Map File: Access and Update
Challenge is to read data from a memory map file and also update the file.
Memory Mapping allows placing large static arrays in virtual memory with good point access times. Minimal consumption of valuable RAM occurs. Medium size TB files can be Mapped on a 64 bit machine. Who has TBs of Hard drive?
With Write Access the Actual file gets data permanently overwritten.
(Note: 8GB logical vector took 60 sec on first large access. Subsequent large accesses returned in msec domain)
Applications include Genome Mapping .
Input: Memory Mapped Variable
Output: Value of location 1
Update location 2 to value of 2
Example:
x is variable
x.data(1:4) is [1234 1111 54543 32465] Change x.data(2) to 2 x.data(1:4) becomes [1234 2 54543 32465] Output location 1 value: 1234
Follow Up Challenge: Busting the Cody 3GB Memory Limit using multiple mapped files.
Solution Stats
Problem Comments
-
1 Comment
I am not sure that I understand the goal of this problem. Memory mapping does not decrease size. Only compression can do it as far as I know (and as long as we are using the adequate data type to our data).
Solution Comments
Show commentsProblem Recent Solvers24
Suggested Problems
-
Find the sum of all the numbers of the input vector
49119 Solvers
-
5902 Solvers
-
279 Solvers
-
357 Solvers
-
315 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!