Reduce the cache size
This commit is contained in:
parent
d5a896b284
commit
5639f3739a
2 changed files with 2 additions and 2 deletions
2
lib/core/cache/image_cache.dart
vendored
2
lib/core/cache/image_cache.dart
vendored
|
@ -4,7 +4,7 @@ import 'package:photos/core/cache/lru_map.dart';
|
|||
import 'package:photos/models/photo.dart';
|
||||
|
||||
class ImageLruCache {
|
||||
static LRUMap<int, File> _map = LRUMap(500);
|
||||
static LRUMap<int, File> _map = LRUMap(25);
|
||||
|
||||
static File get(Photo photo) {
|
||||
return _map.get(photo.hashCode);
|
||||
|
|
2
lib/core/cache/thumbnail_cache.dart
vendored
2
lib/core/cache/thumbnail_cache.dart
vendored
|
@ -4,7 +4,7 @@ import 'package:photos/core/cache/lru_map.dart';
|
|||
import 'package:photos/models/photo.dart';
|
||||
|
||||
class ThumbnailLruCache {
|
||||
static LRUMap<_ThumbnailCacheKey, Uint8List> _map = LRUMap(5000);
|
||||
static LRUMap<_ThumbnailCacheKey, Uint8List> _map = LRUMap(1000);
|
||||
|
||||
static Uint8List get(Photo photo, int size) {
|
||||
return _map.get(_ThumbnailCacheKey(photo, size));
|
||||
|
|
Loading…
Add table
Reference in a new issue