Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Qt 5 stack memory limit?
Forum Updated to NodeBB v4.3 + New Features

[Solved] Qt 5 stack memory limit?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    te777
    wrote on last edited by
    #1

    I'm using Qt 5.1 32 bit for VS2012. My application has a class that gets instantaniated when I press a button on the main form. The class has large arrays. When I try to run the program, it crashes. When I decrease the array sizes by 10 to 1, for example, no problems. The large arrays are for data calculations, Here are the array sizes:

    array1 [100000x4]
    array2 [10000x5]
    array3 [1000x6]
    array4 [100x7]
    array5 [50x8]

    Will using the 64 bit Qt 5 solve my problem?

    I have ported the same program from C# in Visual Studio 2013 compiled for 32 bit, and the code works fine there. I don't know why Qt would be different.

    I'm using Windows 7 SP1 64 bit with 8 GB ram.

    Any help would be appreciated. Thanks in advance.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      This is a compiler settings and not a Qt specific issue. AFAIK this is fix for the application and cannot be solved by using a machine with more RAM. Going from 32 to 64 bit may have an influence but more as a side issue.

      You do not give any details of what kind of variables you are using. Certainly you should use dynamic memory allocation with "new. ":http://www.cplusplus.com/reference/new/operator new[]/

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • T Offline
        T Offline
        te777
        wrote on last edited by
        #3

        I solved the problem by adding a line to my .pro file:

        QMAKE_LFLAGS_WINDOWS += -Wl,--stack,32000000

        for minGW 32 bit compiler

        and

        QMAKE_LFLAGS += /STACK:32000000

        for msvc 32 bit compiler.

        Runs lightening fast. Only adds 2 MB of memory in Task Manager.

        Thanks for the replies.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved