From f802c8f482cc3f7f1d2f94f7c9377feffbe0ed3f Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Fri, 26 Oct 2018 19:16:32 +0900 Subject: [PATCH] evas_image_main: make the cache->usage count eina_file size Summary: The image.data is set to null by evas_common_rgba_image_unload_real. After this point the cache->usage does not count cache_entry.w and h value when evas_gl_common_image_free calls evas_cache_image_flush. So the cache->usage increases just around 300. If the cache->limit is 4194304, then the cache could have around 1398 items. This would be fine. But each items hold eina_file, and the cache does not count eina_file size. If the file size is 326352, then a process could use 456527385 bytes. So this patch set make the cache->usage count eina_file size. This would be better option than https://phab.enlightenment.org/D7029 Reviewers: Hermet, jypark, cedric Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7030 --- src/lib/evas/common/evas_image_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index f99e76aa77..2403a75e2b 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -840,6 +840,7 @@ _evas_common_rgba_image_ram_usage(Image_Entry *ie) if (ie->cache_key) size += strlen(ie->cache_key); if (ie->file) size += strlen(ie->file); if (ie->key) size += strlen(ie->key); + if (ie->f && eina_file_virtual(ie->f)) size += eina_file_size_get(ie->f); if (im->image.data) {