Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

large internal fragmentation #55

Open
BlueSquid1 opened this issue Jan 27, 2017 · 0 comments
Open

large internal fragmentation #55

BlueSquid1 opened this issue Jan 27, 2017 · 0 comments

Comments

@BlueSquid1
Copy link

BlueSquid1 commented Jan 27, 2017

I am using PCLStorage to store files that are send across a network. It works by braking up a large file into many file parts. The file parts are then sent one by one across the network. The client receiving each file part and writes it to the file stream.

The problem is writing small chunks of the file means the OS has no idea how big the complete file will be and therefore makes a poor judgement on how much space to allocate for the file. Just to make sure we are on the same page this wasted space inside a file is called internal fragmentation.

https://puu.sh/tCrgT/28ac28e4ec.png

above is a screenshot of a file I sent across a network. On the left is the original file. On the right is the reconstructed file that has been sent with many parts across the network. The original uses 460KB of allocated memory while the file on the left uses 688KB of allocated memory. Therefore 49% of extra memory is needed for the same file.

my question is can I use your library to indicate to the OS the expected file size?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant