×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    153

    QNetworkAccessManager, large file and memory full

    Hi,
    i'm giving to my app the ability to download an archive from internet; tha is a very large compressed file.
    When i'm downloading it, obviously i get a memory full problem (i'm using readAll).
    I can use a read() to get a block of data and write it into a heap buffer (so i must enlarge the heap of the app).
    After i must use qUncompress that returns a stacked object (so i've also this problem).
    Is there a way to download a file without modify all at compile-time?
    Or that above is wrong and there is another way?

    Thanks
    Gianni
    Merry Christmas Tombola! available on OVI Store!
    SuperDaddy available on OVI Store!

    QT VirtualKeyboard: http://qt-apps.org/content/show.php/VirtualKeyboard?content=107388
    Crack Generator: http://qt-apps.org/content/show.php/MosaicCrack?content=121832

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QNetworkAccessManager, large file and memory full

    As you receive it you need to write it to a file, and then decompress it file-to-file.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    153

    Re: QNetworkAccessManager, large file and memory full

    Quote Originally Posted by danhicksbyron View Post
    As you receive it you need to write it to a file, and then decompress it file-to-file.
    Yes it's right!
    I've written during a receiving of bytes...but now for decompression i must use other algorithm and not qUncompress.
    I found Quazip, but i prefer to use zlib...how can i specify zlib in .pro file?
    Merry Christmas Tombola! available on OVI Store!
    SuperDaddy available on OVI Store!

    QT VirtualKeyboard: http://qt-apps.org/content/show.php/VirtualKeyboard?content=107388
    Crack Generator: http://qt-apps.org/content/show.php/MosaicCrack?content=121832

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: QNetworkAccessManager, large file and memory full

    Of course, if you're using zlib you could decompress it as you receive it, so only one file write.

    zlib is just a few files -- you could either put it in a separate static library or just put the files directly into your project. (Hint, you don't need everything, just the stuff for uncompress.)

  5. #5
    Registered User
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    153

    Re: QNetworkAccessManager, large file and memory full

    Quote Originally Posted by danhicksbyron View Post
    Of course, if you're using zlib you could decompress it as you receive it, so only one file write.

    zlib is just a few files -- you could either put it in a separate static library or just put the files directly into your project. (Hint, you don't need everything, just the stuff for uncompress.)
    Yes, i've used it and a beautiful think is that only the header file is mandatory since zlib is present in the Qt core!
    Merry Christmas Tombola! available on OVI Store!
    SuperDaddy available on OVI Store!

    QT VirtualKeyboard: http://qt-apps.org/content/show.php/VirtualKeyboard?content=107388
    Crack Generator: http://qt-apps.org/content/show.php/MosaicCrack?content=121832

Similar Threads

  1. QNetworkAccessManager memory consumption.
    By ProgrammerVasya in forum Qt
    Replies: 4
    Last Post: 2010-08-04, 13:38
  2. Replies: 2
    Last Post: 2010-03-23, 08:15
  3. Memory Full - while parsing XML file
    By sunitha.m13 in forum Symbian
    Replies: 3
    Last Post: 2009-09-15, 13:32
  4. Memory full problem in drawing jpg file
    By nehasaxena in forum Symbian
    Replies: 8
    Last Post: 2009-08-31, 07:57
  5. File upload using HTTP gives Memory full for large images
    By chandran.biju007 in forum Symbian
    Replies: 23
    Last Post: 2009-07-30, 06:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×