-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
Binary linked with mold has a higher VmHWM value at runtime #1357
Comments
Can you paste the output of |
The binaries are built on Red Hat Enterprise Linux 8.6 using GCC 11.2 and gold 2.42 / mold 2.34.0.
|
Nothing seems to be particularly wrong to me, so it may be just due to noise caused by a layout difference. I'd relink the program with I also want to note that you generally do not have to worry too much about VmHWM after process startup, as what matters is the memory usage while your process is running. |
Using binaries re-linked with |
Generally, the linker doesn't affect a linked program's performance or memory usage. However, there are some random factors, such as file layout. For example, if one linker happens to place initializer functions' machine code in a single page, while with another linker they span two pages, the resident set size of the latter linker will be one page larger than the former after process startup. It does not mean that the former linker works better than the latter; it's just randomness. That randomness appears larger immediately after process startup, as the program doesn't use that memory after all. A small difference at that point shouldn't matter much. What matters is memory usage while the program is actually being used. Did you observe any difference in that situation? |
Thank you for your answer, I think this is what I observe for my program:
The memory usage while the program is actually being used does not change, but there is this fixed memory increase that shows as a regression on all of the steps of my benchmarks. Do you know if there is a way to optimize the linker's output to reduce the number of pages used ? Maybe even from the code itself ? |
Hello,
I am assessing
mold
to replacegold
for linking a C++ binary.While running benchmarks, I have noticed that the VmHWM value from
cat /proc/<PID>/status
is higher (2,5%) at startup with themold
produced binary than with thegold
produced one.I am trying to understand what could be the reason for this increase, do you have an idea?
The text was updated successfully, but these errors were encountered: