Skip to content

map Lookup allocates when key does not exist #1516

@brycekahle

Description

@brycekahle

Describe the bug

In a hot loop of Lookup where a lot of keys do not exist, the fmt.Errorf at

ebpf/map.go

Line 698 in fbb9ed8

return fmt.Errorf("lookup: %w", wrapMapError(err))
can allocate a decent chunk of memory

How to reproduce

  1. Create map
  2. Do a bunch of lookups for keys that do not exist
  3. Profile allocations

Version information

github.com/cilium/ebpf v0.15.1-0.20240709101333-5976561b28aa

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions