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

sf::Ftp Error Bad Alloc durring Big file transfered ! In sfml-Network #565

Closed
masterWarn opened this issue Apr 5, 2014 · 5 comments
Closed
Assignees
Milestone

Comments

@masterWarn
Copy link

Hello,

When transfering binary file, during big file tranfered (more than 500MB). Application crash :

"terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc"

Crash at line:

myFtp.download("1.1.zip","MyFolder", sf::Ftp::Binary);

Ram is full at 70% of the transfer...

Work fine with little files ( <500MB).

Sorry for my english, I'm beginer.

@masterWarn masterWarn changed the title sf::Ftp Error Bad Alloc durring Big file transfered ! sf::Ftp Error Bad Alloc durring Big file transfered ! 🐛 Apr 5, 2014
@masterWarn masterWarn changed the title sf::Ftp Error Bad Alloc durring Big file transfered ! 🐛 sf::Ftp Error Bad Alloc durring Big file transfered ! In sfml-Network Apr 5, 2014
@LaurentGomila
Copy link
Member

Indeed. The full file is stored inside a std::vector, I should find a more clever strategy (like directly writing to the file).

Thanks for your feedback.

@LaurentGomila LaurentGomila added this to the 2.x milestone Apr 5, 2014
@LaurentGomila LaurentGomila self-assigned this Apr 5, 2014
@JesseTG
Copy link

JesseTG commented Apr 6, 2014

This sounds like a job for memory-mapped files.

@masterWarn
Copy link
Author

Perhaps you could use the std::vector as a buffer ?

@LaurentGomila
Copy link
Member

No, no...

No need to throw random thoughts, I know perfectly what I have to do ;)

@masterWarn
Copy link
Author

Ok, thanks :-) !

Thanks for your work, I love SFML !

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

No branches or pull requests

4 participants