Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker gets out of memory #37

Open
crazyjul opened this issue Dec 30, 2013 · 5 comments
Open

Linker gets out of memory #37

crazyjul opened this issue Dec 30, 2013 · 5 comments

Comments

@crazyjul
Copy link

Hi,
I'm trying to build our project using crossbridge, but linking goes over 32bit memory limit.

Do you know any mean to link in several steps or some settings that lower the need for so much memory?

The project is not huge, so any advices would be great

Thanks

@cbakgly
Copy link
Contributor

cbakgly commented Dec 31, 2013

Basically 2 options:
1 dedicate a large memory to abc linking with -jvmopt=-Xmx2000M
2 try LTO to strip out unused symbols: https://github.com/adobe-flash/crossbridge/wiki/Enable-%E2%80%93flto-and-%E2%80%93flto-export-options-to-optimize-your-application-and-reduce-linking-time

On Dec 31, 2013, at 7:54 AM, Julien Hamaide [email protected] wrote:

Hi,
I'm trying to build our project using crossbridge, but linking goes over 32bit memory limit.

Do you know any mean to link in several steps or some settings that lower the need for so much memory?

The project is not huge, so any advices would be great

Thanks


Reply to this email directly or view it on GitHub.

@crazyjul
Copy link
Author

Thanks for the quick answer :
I already have jvmop=-Xmx14G, but it's ld that crashes in a C++ code ( got a std::bad_alloc exception )

I'll try your suggestion on next monday ( I'm off until that )

Thanks again

@crazyjul
Copy link
Author

crazyjul commented Jan 4, 2014

Unfortunately, the flag was the flto-api is already there.

No clue how to solve this issue, but compiling the toolchain in 64 bits

@crazyjul
Copy link
Author

crazyjul commented Jan 4, 2014

Just another question, can I use g++ to merge object together and do the linking in smaller part?

Thanks

@cbakgly
Copy link
Contributor

cbakgly commented Jan 6, 2014

If you compile them into LLVM IR (I mean before convert them into ABC), yes you can use llvm-link.
But even linking into one file, you still have those symbols and still have to convert them into ABC.
Whereas nothing is different in final linking under current design.

So IMHO, it's better to pass as few symbols as possible to decrease the memory demand.
Yes, sometime it's hard. You depend a lib call where in chain you get a lot of dependencies automatically.
Then a smaller code turns into a Big ABC.

On Jan 5, 2014, at 4:29 AM, Julien Hamaide [email protected] wrote:

Just another question, can I use g++ to merge object together and do the linking in smaller part?

Thanks


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants