The browser version you are using is not recommended for this site.
Please consider upgrading to the latest version of your browser by clicking one of the following links.
- Safari
- Chrome
- Edge
- Firefox
Article ID: 000086946
Content Type: Troubleshooting
Last Reviewed: 10/06/2016
cc1plus.exe: out of memory allocating 65536 bytes
Environment
Bug ID: FB: 405528;
Version Found: 13.0
Version Fixed: 17.0
This error may be seen when compiling large software projects on Windows platforms. cc1plus.exe is a 32bit Windows application and has access to 2GB of memory on Windows.
To work around this problem, Windows can be configured to allow 32bit applications access to a 3GB address space.
1. Enable 3GB address space for 32bit applications on Windows:
From Windows command prompt run: bcdedit /set IncreaseUserVa 3072
2. Allow cc1plus.exe to use the larger address space
From Windows command prompt run: editbin /LARGEADDRESSAWARE «<path>/cc1plus.exe“
This problem is scheduled to be fixed in a future release of the SoC EDS Software.
- Description
- Resolution
Need more help?
Give Feedback
Disclaimer
When I try to debug my Qt application I get the following error:
- out of memory allocating 65536 bytes cc1plus.exe
I have an .exe File in the qrc resource which is larger than 10 MB.
I tried QMAKE_CXXFLAGS += -O0 in my .pro file, but I get still the memory error.
- Qt 4.8.4 static compiled
- Windows 7 x64
- 16 GB RAM
- qt
- compiler-errors
![]()
asked Apr 24, 2013 at 7:57
Ser YogaSer Yoga
4561 gold badge6 silver badges16 bronze badges
10
-
Can you please clarify a bit what do you mean by ‘external Qt Program larger then 10Mb in QRC file’?
Apr 24, 2013 at 8:03
-
the executable file which i include in my qrc is bigger than 10 mb. i think it wont change anything when im use two qrc files for my projekt . but i need the executable in my qt application because its a static compiled standalone software without any dlls.
Apr 24, 2013 at 8:14
-
@SerYoga So you do not need the executable in the
.qrcat all, you can simply call it from outside your application.Apr 24, 2013 at 8:18
-
yes but if the exe dont exists outside i need a way to generate the executable in the tmp directory and start it.
Apr 24, 2013 at 8:20
Стоп. Дпавайте разберёмся. Я компилю и компилю неудачно. При компиляции, как я понимаю, создаются секции (неудачно же) с названиями, которые я им определил.
В стек же ничего не пихается при компиляции. Это при исполнении- да.
(Хотя что из себя представляет компиляция, мне трудно сказать. Возможно что и там для gcc создаётся стек, в который всё это дело пихается, не знаю. А тогда: не всё ли равно, как назвать секцию? Имеется ввиду именно для этапа компиляции, а не для этапа исполнения. Понятно что при исполнении разные секции есть разные секции с разными атрибутами прочее)
Добавлено через 4 минуты
![]()
Сообщение от easybudda

вынесите всё это счастье в отдельный файл (mnogo_cifr.dat)
Ещё раз: всё это дело нельзя выносить в отельный файл.
Только в строку, которая объявлена в экзешнике, а затем транспонировать вместе с экзешником. Только так а не иначе.
Ну, вот щас это дело скомпилилось:
| C++ | ||
|
Файлы по метру.
Потом буду увеличивать виртуальную память ещё.
Добавлено через 54 секунды
![]()
Сообщение от easybudda

чувство такое, что заранее на провал обречено… 
fail это файл
Добавлено через 1 минуту
..ИМеется ввиду файлы-бинарники по метру, а *cpp метров по 5 каждый
Добавлено через 5 минут
Ну я понял, что ВЫ имели ввиду, предлагая использовать указатель. Нет, так тоже нельзя. Дело в том, что да, я эту прогу без труда перенесу на другую машину и запущу там и даже предположим, что ось выделит место нужного размера. Но тогда в это место мне придётся пихать… пихать файл *dat, то еесть это файл транспонировать вместе с экзешником. Нет, так не пойдёт.
Добавлено через 13 часов 31 минуту
Короче, щас компилится с тремя подключаемыми файлами *сpp размером соответственно: 0,5 метров. 9 метров и 12 метров. Достиг за счёт увеличения виртуальной памяти до 20 гигов.
В процессе компиляции смотрю на занимаемую утилитами (gcc и иже с ней виртуальную память) в проге Марка Руссиновича «Process Exlorer» (очень рекомендую, кстати), она переваливает временами за 1 гиг
…Если учесть, что на компе одновременно много процессов работает, тогда понятно почему вируальной памяти, установленнной по умолчанию+ оперативной (2 гига), не хватает.
Viewing 3 posts — 1 through 3 (of 3 total)
-
Author
Posts
-
October 8, 2015 at 22:48
#7046
Good afternoon,
I’m running into a problem with Visual GDB compiler.
The toolchain I’m using is Raspberry-Jessie but the problem is with cc1plus.exe
When the application gets to compiling a specific source file (that seems to have a lot of nested includes within other includes) I can see memory usage of cc1plus.exe going up to the 2GB limit windows7 sets for 32 bit applications. It hits around 1.7gB and then in crashes.
If I comment out some functions, any functions, it compiles just below that limit.
When it starts compiling the next file, the memory usage drops and it continues as normal.
So I know it’s not a problem with the code.The two possible solutions I found were:
1. Disabling pre-compiled headers for that file – could not find an option in VisualGDB
2. Somehow setting the Large Address Aware flag to allow using up to 3gb in User Space – also don’t know how.Does anyone know how I can approach this problem? This also seems like something that should be addressed in future releases.
I have a 64gB windows7 system with 16gb of Ram
I don’t experience the same issue when compiling under eclipse or using make in a virtual machine with less memory,
Thanks,
-DOctober 8, 2015 at 23:24
#7047
Hello there,
I have found a temporary workaround to enable 3gB user space addressing.
Will need to open command prompt as an administrator, then type
bcdedit /set IncreaseUserVa 3072Followed by
cd C:Program Files (x86)Microsoft Visual Studio 12.0VCbin
editbin /LARGEADDRESSAWARE «C:SysGCCraspberrylibexecgccarm-linux-gnueabihf4.9cc1plus.exe»
The first part enables 3gB user space for 32 bit applications globally. This might not need be done on Windows 64bit, I think it sets it automatically as long as the application is LargeAddressAware flag set
However, cc1plus.exe does not have largeaddressaware set during compilation, so you will need to set this flag manually. The second command is what does this using a Visual Studio tool editbin.exe
The actual path to this application may be different depending on what version of Visual Studio is used.
This is a temporary workaround because the application may exceed 3gB usage on a per-case scenarion.
Luckily the cc1plus.exe memory usages is on a per-file basis, and it resets when it begins compiling a new file. So it will only be a problem if there are a lot of nested includes in 1 cpp file.
Thanks,
October 9, 2015 at 04:54
#7048
Hi,
Good to know the workaround works. It’s surprising that the cc1plus requires more than 2 gigabytes of RAM, how large is your source file and the included headers (you can find it out by preprocessing it to a file using -E instead of -c)?
-
Author
Posts
Viewing 3 posts — 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Overview
QT sometimes appears when compiling large projectscc1plus.exe: -1: error: out of memory allocating 65536 bytesError message, the possible reason iscc1plus.exeApplication memory overflow. Regardless of whether it is on a 32-bit or 64-bit windows platform, for 32-bit applications, only a maximum of 2GB of memory space can be used by default.
Solution
Problem overview
The 32-bit addressing space is 4GB, and the maximum memory for 32-bit applications can only be 4GB. However, in addition to the memory used by the application itself, the operating system kernel also needs to use it. The memory space used by the application program is divided into user space and kernel space. The user space of each 32-bit program can exclusively share the first 2GB of space (the pointer value is a positive number), while the kernel space is shared by all processes (the pointer value is negative). ). Therefore, the memory address space that a 32-bit application can actually access is only 2GB at most.
first step
in*.proAdd in file
CONFIG += resources_big
Second step
Click the project button on the Qt interface to change theParallel jobsChange the options to be smaller.

third step
turn onVS developer command prompt, Enter the following command to set the user space memory to 3GB
bcdedit /set IncreaseUserVa 3072
Edit applicationcc1plus.exe, So that it can access more than 2GB of memory space
editbin /LARGEADDRESSAWARE <path>/cc1plus.exe
Check whether the configuration is successful
dumpbin /headers <path>/cc1plus.exe | more

if it appearsApplication can handle large (>2GB) address, The configuration is successful.

- Forum
- Qt
- Qt Programming
- Qt resources — cc1plus.exe:-1: error: out of memory allocating
-
Qt resources — cc1plus.exe:-1: error: out of memory allocating
Hi,
I try compile code where inside resources I have files which have +- 20MB and i get following error
cc1plus.exe:-1: error: out of memory allocating 1073745919 bytes
To copy to clipboard, switch view to plain text mode
It is a normal? Whether Qt Resources have some restrictions about size? Or it is a problem with my compiler? I use Qt 5.4 with ming 4.9.1
Thanks,
-
Re: Qt resources — cc1plus.exe:-1: error: out of memory allocating
The Qt resource compiler, rcc, converts the binary data in the .qrc resource file into unsigned char arrays in the qrc_[yourprojectname].cpp file, which is then compiled into an object file by the C++ compiler. This second step is what is blowing up on you. Your 20MB files are resulting in arrays that are too big for the compiler to build.
There is a StackOverflow post that covers this (for MSVC compiler, but the issue and solution are the same). In short, you can’t include resources of this size in the qrc file. You have to deliver them as external resources that are loaded at run time.
-
The following user says thank you to d_stranz for this useful post:
-
Re: Qt resources — cc1plus.exe:-1: error: out of memory allocating
Thanks that works fine but only for small / medium files.
For example my qrc file looks like this
<RCC>
<qresource prefix="/">
<file>ebook.pdf</file>
<file>ebook2.pdf</file>
<file>ebook3.pdf</file>
<file>ebook4.pdf</file>
<file>ebook5.pdf</file>
<file>ebook6.pdf</file>
<file>ebook7.pdf</file>
<file>ebook8.pdf</file>
<file>ebook9.pdf</file>
<file>ebook10.pdf</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
10 ebooks, +- 500MB
and when i run rcc compiler by means of command
rcc --binary --compress 9 resources.qrc -o ebooks.rcc
To copy to clipboard, switch view to plain text mode
then I see dialog of windows application crash
rcc.exe has stopped working...
To copy to clipboard, switch view to plain text mode
I have a lot of memory so that is not a problem. I think that rcc compiler has some restrictions for files size but I do not know why… why? Why they can’t handle file which have +-500MB ( or of course more ) Is there any way for solve this problem?
For this file I think I can divide it on 10 parts and then create 10 rcc files… but what when I have one big file? One file which have 500MB? First divide this file on several small parts and then add to qt resource system? And on end user machine connect all parts to original file?
Thanks,
-
Re: Qt resources — cc1plus.exe:-1: error: out of memory allocating
Why would you want your executable to have several hundred megabytes, maybe even gigabytes in size?
Startup time would be horrible.
Cheers,
_
-
Re: Qt resources — cc1plus.exe:-1: error: out of memory allocating
It is not my idea but that is one of requirements of project — one executable file which contains all dependencies.
Startup time would be horrible.
I have seen several files especially installers or archive of libraries which have similar ( often greater ) sizes and they startup time was a normal / fast.
Thanks,
-
Re: Qt resources — cc1plus.exe:-1: error: out of memory allocating
I assume your compiler and rcc are 32-bit applications. On Windows this gives them a total memory allocation limit of 3GiB. Your compiler is choking trying to allocate a single chunk of memory circa 1GiB in order to slurp up the source file generated by rcc. I am not too surprised this failed either because there was not a GB to be had in total, or because there was not a GB of contiguous memory to be had.
IIRC rcc converts each resource byte into a string «0xnn,» to be part of a C++ source file. That is, there is a four/five fold increase in size over the original binary file size. Your 500MB turns into 2GB of source code. The compress option is of little use with PDFs because they are already compressed. This source is built into the executable/data sections of your executable.
Installers and the like have a very small executable/data section and use other methods to embed data into the same executable file. They get at that data at run time by reading from the file, not by looking for an in-memory structure. I do not know if the Windows native resource system works this way. You might like this:
http://stackoverflow.com/questions/2…sing-gcc-mingwBTW, I would still baulk at a 500MB executable.
Similar Threads
-
Replies: 2
Last Post: 2nd June 2013, 16:34
-
Replies: 2
Last Post: 24th April 2012, 01:09
-
Replies: 1
Last Post: 7th December 2009, 09:07
-
Replies: 4
Last Post: 14th September 2009, 09:35
-
Replies: 2
Last Post: 28th September 2008, 21:20
Bookmarks
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
- BB code is On
- Smilies are On
- [IMG] code is On
- [VIDEO] code is On
- HTML code is Off
Forum Rules
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.
- Печать
Страницы: [1] Вниз
Тема: Qt сжирает весь spaw и память при компиляции (Прочитано 1819 раз)
0 Пользователей и 1 Гость просматривают эту тему.

Zeka13
Qt SDK с реп — всё всегда нормально было
Пишу проектик — у него был в ресурсах один файлик на 5 Mb — Qt немного тормозил при компиляции, теперь файла такий три и того 15Mb в ресурсах
При компиляции этого проекта Ubuntu падает, а винда выдаёт ошибку
cc1plus.exe: out of memory allocating 65536 bytesвот похожая тема, в нете есть похожие темы, но нигде решение на нашёл
http://www.qtcentre.org/threads/23910-cc1plus-exe-out-of-memory-allocating-65536-bytes
Может кто компилировал похожие проекты и решал траблу
« Последнее редактирование: 26 Июня 2012, 14:26:38 от Zeka13 »
Если Wine — это костыль , то Punto Switcher — это протез , а Daemon Tools инвалидное кресло.

Чистый
что это у вас за ресурсы такие ? скиньте их в библиотеку и используйте так проще, если у вас не статическая сборка конечно….
Тестовый репозиторий kdeNeur ppa:devcode/kdeneur
各々が死ぬことをどのように決定する

Zeka13
а в статику нельзя?
просто нужные ресурсы, какая разница?
Если Wine — это костыль , то Punto Switcher — это протез , а Daemon Tools инвалидное кресло.

Чистый
при статической сборке все равно все пихается в исполняемый файл и как следствие ничего не меняется, касательно ресурсов, они слишком большие и правильнее было бы их отделить от исполняемого файла, но это уже вам виднее как разработчику как поступить….
Тестовый репозиторий kdeNeur ppa:devcode/kdeneur
各々が死ぬことをどのように決定する

Zeka13
так как я могу соединить всё в один бинарник?
посоветуйте как сделать, а то как умею — нажать на сборку не работает способ
Если Wine — это костыль , то Punto Switcher — это протез , а Daemon Tools инвалидное кресло.

ChaosWarrior
Зачем вообще такое делать? Не представляю.
Конечно, какая разница? Запихните их сразу в Base64 и в строковую константу.
По приведённой вами ссылке весьма грамотный и точный ответ.
Открытый код и его подержка — это лучшая реклама Windows.

Zeka13
Запихните их сразу в Base64 и в строковую константу
не умею, где узнать как это сделать?
буду очень благодарен за ответ
Пользователь решил продолжить мысль 27 Июня 2012, 00:24:56:
У меня swap шифрованный, смог собрать свой проект на стабильном Debian с обычным swap
Пользователь решил продолжить мысль 27 Июня 2012, 02:53:53:
попробовал вообще без swap скомпилить
g++: внутренняя ошибка компилятора: Убито (program cc1plus)
Пользователь решил продолжить мысль 27 Июня 2012, 03:22:00:
сделал раздел с нешифрованным swap — уже лучше, но система на время компиляции всё равно секунд на 20 встала
на Debian, на котором я компилил 4 Gb ОЗУ и ничего не было запущено, но система вроде не встала, у меня тоже 4 Gb и на свап скушалось около 200Mb, но у меня много свистелок запущено, конечно так не очень компилировать, а что, если я ещё увеличу ресурсы в проекте?
Так как всё таки быть, может есть матёрые программисты?
« Последнее редактирование: 27 Июня 2012, 03:22:51 от Zeka13 »
Если Wine — это костыль , то Punto Switcher — это протез , а Daemon Tools инвалидное кресло.

VlaoMao
Вынеси из ресурсов, делов-то. Зачем пихать лишние 15 метров внутрь бинарника?
Не пойму проблемы.

Zeka13
уже так и сделал)
Пользователь решил продолжить мысль 28 Июня 2012, 22:28:10:
но это оказалось баг компилятора, хотелось бы всё-таки в одном файле прогу держать
Если Wine — это костыль , то Punto Switcher — это протез , а Daemon Tools инвалидное кресло.
- Печать
Страницы: [1] Вверх
|
|
|
|

Правила раздела *nix / gcc / Eclipse / Qt / wxWidgets / GTK+
- При создании темы ОБЯЗАТЕЛЬНО указывайте версию тулкита / библиотеки / компилятора.
- Перед тем как задать вопрос, сформулируйте его правильно, чтобы вас могли понять.
- Нарушение Правил может повлечь наказание со стороны модераторов.
Полезные ссылки:
Boost по-русски
Qt по-русски

Ошибка при отладке
, QT4+minGW+QDevelop
- Подписаться на тему
- Сообщить другу
- Скачать/распечатать тему
|
|
|
|
Сделал проект. В Линуксе все ок. При сборке в винде или просто при запуске готового .ехе выдается ошибка (вложено). Прикреплённая картинка
|
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
Что-то происходит не так. Исключение не пойманное, исключение выпущенное из деструктора, просто вызов terminate и т.п. |
|
vova |
|
|
Я понял, что что-то не так.
…………………………………………………. mingw32-make.exe[1]: Leaving directory `C:/Documents and Settings/Вова/My Documents/07_ЕОМіМП/kursak/win/TimeTable_s_old’ cc1plus.exe: out of memory allocating 65536 bytes mingw32-make.exe[1]: *** [releaseTimeTable.o] Error 1 C:QTMinGWStudioMinGWbinmingw32-make.exe: *** [release] Error 2 В чём может быть ошибка? |
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
Да в чём угодно. Ты слишком мало информации предоставляешь и слишком многого за это просишь… |
|
vova |
|
|
В первый раз собралась и запустилась, во второй — окошко из первого поста и
Отладка… (no debugging symbols found)…(gdb) (gdb) (gdb) (gdb) (gdb) Starting program: C:/Documents and Settings/Aiaa/My Documents/07_AII?II/kursak/win/TimeTable_s_old/release/TimeTable.exe Program exited with code 03. ———————- Отладка завершена ———————- Что значит «Program exited with code 03.»? то, что отладку просто остановили? тогда почему в первый раз нориально. Сообщение отредактировано: vova — 16.12.07, 19:23 |
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
Значит main вернула значение 3. К слову, можешь даже не пробовать отлаживать с помощью gdb прогу, расположенную в папке, имя которой содержит пробелы или русские символы. Ну и отладочную информацию включить неплохо было бы(IIRC: в .pro написать CONFIG += debug). По поводу ошибки компилятора: ну ты хоть версию его скажи(в консоли написать gcc -v). |
|
vova |
|
|
C:>gcc -v Reading specs from C:/QT/MinGWStudio/MinGW/bin/../lib/gcc-lib/mingw32/3.3.1/spec s Configured with: ../gcc/configure —with-gcc —with-gnu-ld —with-gnu-as —host= mingw32 —target=mingw32 —prefix=/mingw —enable-threads —disable-nls —enable -languages=c,c++,f77,objc,ada,java —disable-win32-registry —disable-shared —e nable-sjlj-exceptions —enable-libgcj —disable-java-awt —without-x —enable-ja va-gc=boehm —disable-libgcj-debug —enable-interpreter —enable-hash-synchroniz ation Thread model: win32 gcc version 3.3.1 (mingw special 20030804-1)
на счёт русских букв и пробелов — то при установке в «програм файлы» не находился gdb. установил в C:/QT/MinGWStudio/. Заработало. |
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
vova, 3.4.2 поставь. |
|
vova |
|
|
Перенёс . результат не изменился. |
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
vova, я про отладку, а не про ф-ционирование — насколько я могу судить, gdb не понимает пробелы/русские буквы. |
|
vova |
|
|
Цитата archimed7592 @ 16.12.07, 19:37 vova, 3.4.2 поставь. я поставил со сайта просто последнюю версию MinGWStudio (ну и по дурацки устанавливается — через интернет с какой-то шары). Где взять gcc 3.4.2? И что может значить ошибка, в каком направлении искать
terminate called after throwing an instance of ‘std::logic_error’ what(): basic_string::_S_construct NULL not valid Аварийный останов |
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
1) mingw.org 2) значит где-то было выброшено исключение и никем не отловлено. Я тебе всю ветку про исключения талдычу… Может быть стоит разуть глаза? |
|
vova |
|
|
Пробую разуть глаза. Нашёл одну ошибку.
…… C:QTMinGWStudioMinGWbin..libgcc-libmingw323.3.1……..mingw32binld.exe: cannot find -lqtmaind mingw32-make.exe[1]: *** [debugTimeTable.exe] Error 1 C:QTMinGWStudioMinGWbinmingw32-make.exe: *** [debug] Error 2 ———————- Сборка завершена с 2 ошибками ———————- Что это значит. Как можно заставить давать более подробные и вразумительные сообщения? |
archimed7592 |
|
|
Moderator
Рейтинг (т): 225 |
Цитата vova @ 18.12.07, 20:31 Как можно заставить давать более подробные и вразумительные сообщения? Всё очень даже вразумительно. Компилятор не может найти библиотеку qtmaind. Тебе нужно скачать gcc и g++ версии 3.4.2, потом собрать Qt под этот компилятор, потом собирать свою прогу. |
|
vova |
|
|
qt4 было из ехе уже собраннное под mingw (под какую версию — не знаю). |
0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
0 пользователей:
- Предыдущая тема
- Кроссплатформенный C/C++: cl/gcc/Qt/Gtk+/WxWidgets
- Следующая тема
[ Script execution time: 0,0726 ] [ 16 queries used ] [ Generated: 28.01.23, 17:10 GMT ]



.

. Нашел ошибку — компилятор нашел библиотеку. Ошибк была — парсер хмл файла в случае пустой строки возвращал не «», а NULL. я это не проверял и через string.c_str() запихивал в ячейки таблицы