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
This commit is contained in:
Shinwoo Kim 2018-10-26 19:16:32 +09:00 committed by Hermet Park
parent fa7d83b993
commit f802c8f482
1 changed files with 1 additions and 0 deletions

View File

@ -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)
{