I wrote an application with Qt 4.8.1 and MinGW32 (Nokia Qt SDK). I try to load a large file with this app, but the app always crash when memory usage reach 1,868 MB. If I reduce the size of input file the app works fine. Is there any memory limitations on Qt apps or MinGW32? What should I do if I really want my app to use more memory? My windows is 64 bit.
p.s. Adding "QMAKE_LFLAGS_WINDOWS += -Wl,--stack,32000000" to .pro file won't work
Thanks very much!
p.p.s. I saw many software are capable of using 10+ GB, e.g. Matlab, how to do that on Qt apps?
Your copy of windows may be 64 bit, but MingW32 is a 32 bit compiler, so any app written with that compiler has all the standard limits inherent to 32 bit Windows. Effectively, you won't be able to get more than around 2G of memory for your app to use.
There's a method to get that up to 3G, but beyond that you need a 64 bit compiler.
2GB is limit is for process only.
You can spread your application along N processes (32-bit) to allocate N x 2GB. Operating system must still be 64-bit.
Related
I'm deploying an app developed by Qt for both Windows and Linux:
On Windows I'm using built-in Qt windeployqt tool:
windeployqt.exe app.exe --qmldir %NS_REPO_DIR%\qml\
On Linux I'm using linuxdeployqt:
linuxdeployqt_EXE="${NS_REPO_DIR}/scripts/linuxdeployqt/linuxdeployqt-7-x86_64.AppImage"
${linuxdeployqt_EXE} app -qmake=${NS_QT_QMAKE_EXE} -qmldir=${NS_REPO_DIR}/qml/
The deployment size for Windows is around 70 MB and for Linux is around 300 MB. Is it normal? Is there anything I might be missing?
Thanks!
Update
This is my deployment on Linux whose content is sorted by size. The Qt files don't look like to be debug mode. Also, there is a huge libQt5WebEngineCore.so.5.12.7 file of 111 MB:
We would have to blame here to all the GNU/Linux distributions makers for changing so many things.
Unlike Windows that there are only few version Windows 7,8, 10 and that is it. In GNU/Linux we have so many versions and variants that we have to include "almost" everything that an application needs to ensure it will run on the majority of the existent system variants.
Said that, you can manually check the files deployed in your AppDir manually and remove those you know that your application will not require.
Side note: While linuxdeployqt is still functional there are other tools that do a better job. Consider checking https://github.com/linuxdeploy/ and https://github.com/AppImageCrafters/appimage-builder
I have written a program in Java on a 64 bit Window OS, but now I need my program to work on a 32 bit Window OS. How can I do this? (For making an exe file I used launch4j)
For Java, if the machine has the Java 32-bit is installed, then running the exe alone will be enough. If you want to provide redistributable, just use the java 32-bit redistributable.
Electron : 1.4.4
Operating system:windows 7 ,My windows 7 is a virtual machine. 2GB ,1 kernel
node-sqlite3:3.1.8 ,used a db file.
electron-builder:7.24.1
node:7.0.0
I'm working on Mac OS.Make an electron project,using sqlite3 to store data.Every thing is ok on my mac.So I build an installer exe file for windows .Before, I used electron-rebuild.cmd on windows build the sqlite3 module, and success.Then use electron-builder build exe file,and success.When installed to windows,and run the app,the cpu runs 100%.I caught a cpu profile and found only some ajax post take 100ms, nothing else.Then I take a look at the log found that sometimes the database takes a lot time (10m about),sometime it's not. I'm very confusion.I think may be the sqlite3 module has problems.Did any one has ideas about it?
Thanks a lot!
This is a familiar issue, I suggest trying the workaround mentioned in a related issue, which is to increase the number of CPU cores available to the VM to at least two.
The compile times on Windows 7 with Qt, using MSVC10 express and MS SDK 7.1 are longer than they were under Windows XP (still using MSVC10). What's more, when using MinGW my compile times are faster than either MSVC10 scenario.
The CPU seems to only spend 10% max and "Jom" is present.
Would anyone have an idea as to what might cause this? Is there anything I can do to speed up my compile times?
You mention that jom is present. Please set for the make-command the parameter "-j 8". Where 8 is just as example - not sure how many threads your machine can fed properly. Because your cpu-usage of ~10% indicates that just a single core is used.
I recently installed a 64bit OS on my computer, I thought that sizeof(char*) would give me 8 instead of 4. Shouldn't I get a 64 bit addresses in my pointers?
This is because the compiler you are using is emitting 32 bit code. If you use a 64 bit compiler then pointers will be 8 bytes wide.
Note that most 64 bit systems have the ability to run 32 bit code under an emulation layer. On Windows the emulation layer is known as WOW64. This is clearly what is happening here.
The OS typically has no effect on code generation. If you run the same compiler and the same libraries, you will get the same code out, regardless of whether the OS is 32-bits or 64-bits. You can compile and run 32-bit software on a 64-bit OS. You can compile 64-bit software on a 32-bit OS.
The compiler determines the type of code generated. The OS only determines whether you can run it.
Yes, you should, but note that a same operating system can run both 32-bit and 64-bit code, and that in the "64bit OS" you installed, the "64bit" may only mean "64bit able".
You really should give more detail here about the particulars of the OS. Mac OS X Snow Leopard , for instance, comes with versions of GCC and Clang that default to 64-bit code, and you can use option -m32 to generate 32-bit code. Perhaps the convention is reversed on your 64-bit OS (that is, you should use -m64 or a similar option)