Results 1 to 8 of 8

Thread: Maximum size for local storage using a qt applciation

  1. #1
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Maximum size for local storage using a qt applciation

    I am creating an application where in I will be storing some data in QSetting.
    I would like to know what's the maximum storage size, if it uses system registers.
    Last edited by ejoshva; 27th March 2015 at 11:01.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximum size for local storage using a qt applciation

    If you look at the API of QFile (and its base class QIODevice), you'll see it uses qint64 as its size type.
    So its limit of addressable size is 2^63 - 1 bytes.

    Somewhere in the Exabyte range if I remember correctly.

    Cheers,
    _

  3. #3
    Join Date
    Oct 2009
    Posts
    483
    Thanked 96 Times in 93 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximum size for local storage using a qt applciation

    Qt's API for manipulating files (e.g. QFile) by itself imposes no unreasonable limits beyond those of the underlying platform. For instance, all positions in QIODevice-derived classes are represented by qint64. In theory, the API can cope with files up to 2^63 bytes long.

    However, you have to be careful with how you use this API if you want your application to scale. For instance, if you use a QNetworkReply to download a file and write it to disk with QFile, make sure you read and write in blocks whose size is bounded; avoid methods like QIODevice::readAll().

  4. #4
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Maximum size for local storage using a qt applciation

    What is the maximum size I can store in QSETTINGS

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximum size for local storage using a qt applciation

    For a single key? Very likely backend specific, i.e. a INI file value is probably restricted differently than a Window Registry value.

    Cheers,
    _

  6. #6
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Maximum size for local storage using a qt applciation

    yes for single key

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximum size for local storage using a qt applciation

    Stop changing the topic and content of the thread, this is annyoing to anyone involved and extremely confusing to anyone finding the thread later on!

    You can likely find the restrictions for Windows Registry somewhere on MSDN.
    A couple of hundret characters are surely no problem, maybe even a couple of Kilobytes.

    For INI it is very likely larger than anything you might want to put into a INI file value in the first place, RAM is usually magnitudes smaller than disk space.

    Cheers,
    _

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,714
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Maximum size for local storage using a qt applciation

    RAM is usually magnitudes smaller than disk space
    Windows Registry key and value sizes are discussed in MSDN.

    If you use an INI file format, then you will be limited by the smaller of:

    - the amount of RAM you have available for creating the thing (string, array, whatever) you want to write to QSettings
    - the maximum size of files allowed in your Windows version and disk format
    - size limits imposed by whatever Qt/C++ type you are using to hold the information

    What are you trying to store? And if it is big enough to worry about size, why would you want to store it in the Registry anyway? This sounds like something that is more appropriate for a configuration file stored on disk, not something that uses a system resource.

    Why should your users suffer the cost of having the Registry using up larger than needed system resources ALL THE TIME, whether they are using your program or not?

Similar Threads

  1. Accessing sql local storage from C++?
    By Koying in forum Qt Quick
    Replies: 1
    Last Post: 27th February 2014, 21:49
  2. The maximum size of a QList
    By Denarius in forum Newbie
    Replies: 3
    Last Post: 30th November 2012, 11:27
  3. Get maximum size a widget can get
    By joseprl89 in forum Qt Programming
    Replies: 0
    Last Post: 8th August 2011, 09:57
  4. Replies: 6
    Last Post: 27th July 2010, 22:07
  5. maximum size of xml files
    By freeskydiver in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2008, 11:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.