Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Memory mapping a file on a SMB file share causes it to be transferred in its entirety before the call returns. For large files, this causes the application to lock up for a long period of time. How do I fix this?

"Use X instead of SMB" is a valid answer.

Edit: Any application, any file. I'm not trying to solve a specific case. Memory mapping a file is a way of opening it so that it appears to the application as part of the working memory - you access the file as if it's an array.

share|improve this question
    
Why not to put the file on a local filesystem? –  Alex Aug 27 '11 at 10:08
1  
Which application? Which file? Memory mapped what? Fix what? –  mailq Aug 27 '11 at 10:08
    
So little information. Are you looking for something like this answer? –  Steve-o Aug 27 '11 at 16:00
add comment

closed as not a real question by mailq, womble, MDMarra, sysadmin1138 Aug 27 '11 at 23:44

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 2 down vote accepted

This is an artifact of the operating system's implementation of mmap, not anything to do with the network protocol in use (as much as I love to rag on SMB...). SMB is more than capable of reading random chunks out of a file, therefore there's no reason it couldn't read chunks as they're requested. I don't have an SMB server accessable at this moment to verify it, but I do have an NFS server, and I just tried to mmap a 1.7GB file and it returned instantaneously, so at the very least it certainly isn't some inherent limitation in the concept of mmap.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.