I am trying to compile some relatively heavy template code with MSVC (2010), and it ultimately exits with fatal error C1060: compiler is out of heap space.
fatal error C1060: compiler is out of heap space
All this is just one translation unit, and, in comparison, gcc processes it quite easily (inside a virtual machine with significantly fewer resources).
Any clues what to look for? Are there suitable compiler options?
You might be able to come across this by explicitly adding the / Zm option to the C / C ++ options of your project. e.g. / Zm256
/Zm, . , , , .
C1060 , . , Foo :
template< typename T1, typename T2, typename T3 > struct Foo { T1 t1; T2 t2; T3 t3; }; Foo< int, char, bool > foo;
.
template< typename T_ARG > struct Foo { typename T_ARG::T1 t1; typename T_ARG::T2 t2; typename T_ARG::T3 t3; }; struct FooArgs { typedef int T1; typedef char T2; typedef bool T3; }; Foo< FooArgs > foo;
, :
, - , :
cl.exe, 2 32- Windows. Windows 4- , 2 2 . 1/3. Windows 7 Vista :
bcdedit/set IncreaseUserVa 3072
. MSVC 3 2.
, - C1060. Resource Monitor, cl.exe 2 . .
1 . 2/2, :
bcdedit/deletevalue IncreaseUserVa
( ), /Zm1000 ( ). , , / .., :
/Zm1000
C1060: .
, - ( ). , 32 , 6,1 . x64, .
MSDN , /Zm800 . , ; /Zm2000 32- ( , /Zm - ).
/Zm800
/Zm2000
/Zm
I am using MSVC 6.0, but I hope this helps in 2010 as well.
Source: https://habr.com/ru/post/1783741/More articles:WmAutoUpdate - Has anyone used it? Do Not Rollback - c #How to print a PDF file created using iText? - javaJava EE - One to Many Bidirectional - javasql studio express 2005 потерял пароль для паролей - sqlASP.NET session disappears / reappears - asp.nethttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1783742/autotools-copy-data-files-to-staging-area&usg=ALkJrhg4kU46XhJKdsmld_y7vX-v-67LUQPenetration Javascript - javascriptWindows Phone 7 with mDNS / Bonjour - .netAndroid Modify Zip FIle - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1783746/how-to-implement-tokenizerrbegin-and-rend-for-boosttokenizer&usg=ALkJrhh3Fruppj4to7Fk71ieVETTsplVwgAll Articles