Closed Bug 1672595 Opened 5 years ago Closed 4 years ago

Why are there so many <8-byte allocations?

Categories

(Core :: Memory Allocator, task)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: pbone, Assigned: pbone)

References

(Depends on 1 open bug)

Details

In jemalloc-replay stats I see that there is 19KiB used by objects 8-bytes or smaller.

8-bin Distribution:
request   :  count percent
1 -     1:     58      3%
2 -     2:     29      1%
3 -     3:    177      8%
4 -     4:    134      6%
5 -     5:    182      8%
6 -     6:    281     13%
7 -     7:    156      7%
8 -     8:   1127     52%

Ideally we should not be allocating such small objects at all, since they fit within a pointer anyway. I expect some of these are things like strings that are sometimes long and sometimes short, but I'd like to know for sure.

You should probably look at = 8 bytes allocations too, we might have the surprise that it's for small structs. It might be useful to instrument operator new.

Depends on: 1736764
Depends on: 1736809

I've checked out all the cases of 8 byte allocations.

  • The majority are short strings allocated from third-party code like libfontconfig.
  • Bug 1736764 shows a case where a small object can be inlined.
  • Bug 1736809 is a case of short strings that we could inline, but is hardly worth it for only 128 bytes.
  • The rest are two small to even look at.

Marking as fixed since this concludes the investigation.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Assignee: nobody → pbone
You need to log in before you can comment on or make changes to this bug.