cc1plus.exe: out of memory allocating 65536 bytes

Sysprogs forums Forums VisualGDB cc1plus.exe: out of memory allocating 65536 bytes

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7046
    dmitryponv
    Participant

    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,
    -D

    #7047
    dmitryponv
    Participant

    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 3072

    Followed by

    cd C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
    editbin /LARGEADDRESSAWARE "C:\SysGCC\raspberry\libexec\gcc\arm-linux-gnueabihf\4.9\cc1plus.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,

    #7048
    support
    Keymaster

    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)?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.