mirror of
https://github.com/usememos/memos.git
synced 2025-12-18 22:59:24 +08:00
Address high memory usage when opening resource tab (fixes #5183) by implementing:
1. Concurrency control: Limit thumbnail generation to 3 concurrent operations using semaphore to prevent memory exhaustion when many images are requested simultaneously
2. S3 optimization: Skip server-side thumbnail generation for S3-stored images by default. S3 images now use presigned URLs directly, avoiding:
- Downloading large images from S3 into server memory
- Decoding and resizing images on the server
- High memory consumption during batch requests
3. Memory management improvements:
- Explicitly clear blob and decoded image from memory after use
- Restructure thumbnail cache check to avoid unnecessary semaphore acquisition
- Double-check pattern to prevent duplicate generation while waiting
This restores the original S3 behavior before commit
|
||
|---|---|---|
| .. | ||
| test | ||
| acl.go | ||
| acl_config.go | ||
| activity_service.go | ||
| attachment_service.go | ||
| auth.go | ||
| auth_service.go | ||
| auth_service_client_info_test.go | ||
| common.go | ||
| health_service.go | ||
| idp_service.go | ||
| instance_service.go | ||
| logger_interceptor.go | ||
| memo_attachment_service.go | ||
| memo_relation_service.go | ||
| memo_service.go | ||
| memo_service_converter.go | ||
| memo_service_filter.go | ||
| reaction_service.go | ||
| resource_name.go | ||
| shortcut_service.go | ||
| test_auth.go | ||
| user_service.go | ||
| user_service_stats.go | ||
| v1.go | ||