[Windows] Build Chrome Error - "LINK : fatal error LNK1102: out of memory"

504 views
Skip to first unread message

Palash Verma

unread,
Apr 30, 2018, 12:44:49 PM4/30/18
to Chromium-dev
Hi,

I'm trying to build chrome and using these commands -

    > gn gen --ide=vs out/Default --args="is_component_build = true is_debug = true"
    > ninja -C out\Default chrome

but having an error after executing the 2nd command, the command output -

    > ninja: Entering directory `out\Default'
    > [35675/36224] LINK(DLL) blink_core.dll blink_core.dll.lib blink_core.dll.pdb
    > FAILED: blink_core.dll blink_core.dll.lib blink_core.dll.pdb
    > E:/Chromium/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo  /IMPLIB:./blink_core.dll.lib /DLL /OUT:./blink_core.dll /PDB:./blink_core.dll.pdb @./blink_core.dll.rsp
    > LINK : fatal error LNK1102: out of memory
    > ninja: build stopped: subcommand failed.

I have a 64-bit system with 8GB of RAM. What can be causing the problem?

Thanks.

Ryan Tseng

unread,
Apr 30, 2018, 1:05:05 PM4/30/18
to palash...@gmail.com, Chromium-dev
You probably need more RAM


Or try running with less parallelism. eg: add "-j1" to you ninja invocation.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/93b89439-0081-4014-92ca-015096bed657%40chromium.org.

bruce...@chromium.org

unread,
May 2, 2018, 7:33:27 AM5/2/18
to Chromium-dev, palash...@gmail.com, hin...@chromium.org
This page:


lists some suggestions for making linking faster, and these suggestions also (I believe) reduce the amount of memory used by linking. In particular you should either set is_win_fastlink = true or use_lld = true. I would recommend trying the latter.

Installing more memory will also help, and make sure you aren't running too much other software and that you have paging enabled. 8 GB is not a lot for building Chrome so you will have to be careful.

Palash Verma

unread,
May 6, 2018, 10:45:31 PM5/6/18
to Chromium-dev
I used both the suggestions and it worked.

    > gn gen --ide=vs out/Default --args="is_component_build = true is_debug = true use_lld = true"
    > ninja -C out\Default chrome -j1

Although this time the build was running slower, guessing it's because of "-j1" but I'm glad it worked out.
I still don't know if using "is_component_build" with "use_lld" was a good idea or I should've used only one of these at a time.

Thanks for all the help.

Daniel Bratell

unread,
May 7, 2018, 9:53:11 AM5/7/18
to Chromium-dev, Palash Verma
On Mon, 07 May 2018 04:45:31 +0200, Palash Verma <palash...@gmail.com> wrote:

I used both the suggestions and it worked.

    > gn gen --ide=vs out/Default --args="is_component_build = true is_debug = true use_lld = true"
    > ninja -C out\Default chrome -j1

Although this time the build was running slower, guessing it's because of "-j1" but I'm glad it worked out.
I still don't know if using "is_component_build" with "use_lld" was a good idea or I should've used only one of these at a time.

Good that it worked!

You wouldn't need to run the whole build with -j 1, only the parts where you run out of memory.
So
ninja -C out\Default chrome
*building and eventually running out of memory*
 ninja -j 1 -C out\Default chrome 
* building the rest single threaded*

May save you a bit of time next time.

/Daniel


--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Bruce Dawson

unread,
May 8, 2018, 6:06:20 AM5/8/18
to Daniel Bratell, Chromium-dev, Palash Verma
Back in the GYP days I know that linker parallelism was capped at floor(MemInGB/5) which would mean that linker parallelism was already capped to one at a time. If that is still the case then -j 1 is probably not necessary, although it would prevent compiles from running in parallel with links. I think that this calculation still applies - at least, _GetDefaultConcurrentLinks in get_concurrent_links.py is still run.

GYP_LINK_CONCURRENCY is the environment variable that can be used to override link parallelism, but there should be no need to do this. I think that use_lld = true has resolved the issue.

> I still don't know if using "is_component_build" with "use_lld" was a good idea or I should've used only one of these at a time.

That's fine. They are totally compatible. I always use use_lld=true. It will probably be the default soon.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to a topic in the Google Groups "Chromium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-dev/wgmULkhYjpk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/op.zincsxhprbppqq%40cicero2.linkoping.osa.
Reply all
Reply to author
Forward
0 new messages