[GH-ISSUE #1761] Memory usage of initials avatar #6476

Closed
opened 2026-04-20 17:04:55 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @maggch97 on GitHub (Nov 6, 2025).
Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/1761

Description

Each avatar generation needs about 500MB memory, when generating avatar concurrently, it's easy to cause OOM

Image
=== RUN   TestSequentialVsConcurrentMemory
=== RUN   TestSequentialVsConcurrentMemory/Sequential
    memory_analysis_debug_test.go:177: Sequential generation of 10 avatars:
    memory_analysis_debug_test.go:178:   Heap delta: 80.03 MB
    memory_analysis_debug_test.go:179:   Total alloc: 5859.82 MB
    memory_analysis_debug_test.go:180:   Per avatar: 585.98 MB
=== RUN   TestSequentialVsConcurrentMemory/Concurrent
    memory_analysis_debug_test.go:213: Concurrent generation of 10 avatars:
    memory_analysis_debug_test.go:214:   Heap delta: 80.00 MB
    memory_analysis_debug_test.go:215:   Total alloc: 5859.80 MB
    memory_analysis_debug_test.go:216:   Per avatar: 585.98 MB
--- PASS: TestSequentialVsConcurrentMemory (0.30s)
    --- PASS: TestSequentialVsConcurrentMemory/Sequential (0.24s)
    --- PASS: TestSequentialVsConcurrentMemory/Concurrent (0.07s)
PASS
ok      code.vikunja.io/api/pkg/modules/avatar/initials 0.730s

Vikunja Version

1.0.0

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

Please select

Screenshots

No response

Originally created by @maggch97 on GitHub (Nov 6, 2025). Original GitHub issue: https://github.com/go-vikunja/vikunja/issues/1761 ### Description Each avatar generation needs about 500MB memory, when generating avatar concurrently, it's easy to cause OOM <img width="686" height="84" alt="Image" src="https://github.com/user-attachments/assets/730ba68c-980d-4442-b33f-2dc18e1c2c7d" /> ``` === RUN TestSequentialVsConcurrentMemory === RUN TestSequentialVsConcurrentMemory/Sequential memory_analysis_debug_test.go:177: Sequential generation of 10 avatars: memory_analysis_debug_test.go:178: Heap delta: 80.03 MB memory_analysis_debug_test.go:179: Total alloc: 5859.82 MB memory_analysis_debug_test.go:180: Per avatar: 585.98 MB === RUN TestSequentialVsConcurrentMemory/Concurrent memory_analysis_debug_test.go:213: Concurrent generation of 10 avatars: memory_analysis_debug_test.go:214: Heap delta: 80.00 MB memory_analysis_debug_test.go:215: Total alloc: 5859.80 MB memory_analysis_debug_test.go:216: Per avatar: 585.98 MB --- PASS: TestSequentialVsConcurrentMemory (0.30s) --- PASS: TestSequentialVsConcurrentMemory/Sequential (0.24s) --- PASS: TestSequentialVsConcurrentMemory/Concurrent (0.07s) PASS ok code.vikunja.io/api/pkg/modules/avatar/initials 0.730s ``` ### Vikunja Version 1.0.0 ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? Please select ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Nov 7, 2025):

There are plans of moving the initials avatar generation to generate an svg instead. That should solve this problem and has a few other benefits like scaling well on high-res monitors.

<!-- gh-comment-id:3501882515 --> @kolaente commented on GitHub (Nov 7, 2025): There are plans of moving the initials avatar generation to generate an svg instead. That should solve this problem and has a few other benefits like scaling well on high-res monitors.
Author
Owner

@kolaente commented on GitHub (Nov 7, 2025):

Related: https://github.com/go-vikunja/vikunja/issues/549

<!-- gh-comment-id:3501885601 --> @kolaente commented on GitHub (Nov 7, 2025): Related: https://github.com/go-vikunja/vikunja/issues/549
Author
Owner

@kolaente commented on GitHub (Nov 12, 2025):

Should be fixed with https://github.com/go-vikunja/vikunja/pull/1802, please check with the next unstable build (should be ready for deployment in ~30min, also on try).

<!-- gh-comment-id:3524172486 --> @kolaente commented on GitHub (Nov 12, 2025): Should be fixed with https://github.com/go-vikunja/vikunja/pull/1802, please check with the next unstable build (should be ready for deployment in ~30min, also on [try](https://try.vikunja.io)).
Author
Owner

@maggch97 commented on GitHub (Nov 13, 2025):

Should be fixed with #1802, please check with the next unstable build (should be ready for deployment in ~30min, also on try).

It works and it also fiexed a bug that Chinese charactors cannot be rendered successfully in the avatar

<!-- gh-comment-id:3525320965 --> @maggch97 commented on GitHub (Nov 13, 2025): > Should be fixed with [#1802](https://github.com/go-vikunja/vikunja/pull/1802), please check with the next unstable build (should be ready for deployment in ~30min, also on [try](https://try.vikunja.io)). It works and it also fiexed a bug that Chinese charactors cannot be rendered successfully in the avatar
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#6476