Comments (4)
You are missing multiple important points:
- The INTFileStore API is designed to match the Windows Native API.
- In 5 years of working with the library (and some very large files) I did not have a single issue with RAM usage.
- Using Streams does not magically reduce RAM usage.
I suggest you look for the real reason you are getting "out of memory".
from smblibrary.
for a simple use case, try to load a 10G file with a system with 6G available ram. you cannot load it all into a byte array, the program will crash with out of memory exception.
if you store an entire file into byte[]
then you will use up the amount of ram equivalent to that file size. on a system with limited ram, you will run out of memory easily.
streaming on the other hand will not at any point store the entire file into the ram instead streams it to the consumer of the data so they can access it incrementally.
from smblibrary.
Of course you can't (and shouldn't) load an entire file into RAM. You also shouldn't load an entire file into a MemoryStream.
OutOfMemoryException is the result of inefficient programming, it can happen with both byte arrays and streams. the fact that you think that switching to streaming will somehow magically solve all your problems tell me that you are lacking experience.
When working with files, you should simply load (from the stream or other source of file data) the bytes that have been currently requested into the byte array, each SMB request is for about 64KB. so you shouldn't have any issues with excessive RAM usage.
In any case, I am not going to change the API. if you feel that the current API does not serve your special needs, feel free to fork the project and customize it to your needs.
from smblibrary.
ah that makes sense. i didn't look closely enough to see that you don't load the whole file at once. That was the piece I was missing.
from smblibrary.
Related Issues (20)
- the ability to add a share while the server is running HOT 8
- Does the library plan to migrate to `c# 8.0` and later. HOT 1
- Are there any plans to migrate the library to `async'? HOT 1
- Not able to write nested directories (folders) to server HOT 3
- Get the original password during authorization HOT 7
- Not able to access file in sub-directory. HOT 4
- Return status on server startup. HOT 2
- Can't access most QueryDirectoryFileInformation attributes HOT 2
- Connecting to Subshare throws STATUS_BAD_NETWORK_NAME HOT 1
- What is NTStatus 3221225680? HOT 1
- Issue with Creating Nested Folders and Files Using SMBLibrary in AWS Lambda HOT 2
- The server is returning STATUS_SHARING_VIOLATION while creating a handle to delete a folder. HOT 1
- SMB 3.1.1 Support HOT 1
- How do I hide a shared folder? HOT 1
- System.Net.Sockets.SocketException: Connection reset by peer HOT 5
- Not enough credits due to connection resilience issues HOT 4
- Authntication Failed HOT 5
- High RAM consumption. HOT 10
- Is it possible to get a login and NTLM? HOT 4
- Making ClientMaxReadSize and ClientMaxWriteSize Configurable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smblibrary.