jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cb3b4cc8d7794bea575a85325c8a58f25f0507b2
commit cb3b4cc8d7794bea575a85325c8a58f25f0507b2 Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Fri Sep 15 14:39:14 2017 +0900 elm image: Fix async open to avoid multiple mmap Reported by @jiin.moon: In case of async_open for an elm_image, we try and open a file in a thread, then map it and populate a bit, as this may take some time (blocking I/O). This creates a mmap with eina_file_map_new. But later evas image loaders will (usually) try and map the entire file with eina_file_map_all() which creates another mmap. Since the size is different (32Kb first then all) the returned map might be different (it's up to the kernel to decide at this point). So, in order to avoid having multiple maps on the same file, and try to reduce the peak memory usage, we should prefer using the same map all the time, i.e. the global one returned by eina_file_map_all(). This patch relies on the previous patch in eina_file which fixes eina_file_map_populate() for the global map. @fix --- src/lib/elementary/efl_ui_image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index b8f0486241..093e79bff2 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -323,7 +323,8 @@ _efl_ui_image_async_open_do(void *data, Ecore_Thread *thread) // blindly load in here to let's say 32KB (Should be enough to get // image headers without getting to much data from the hard drive). size = size > 32 * 1024 ? 32 * 1024 : size; - map = eina_file_map_new(f, EINA_FILE_POPULATE, 0, size); + map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); + eina_file_map_populate(f, EINA_FILE_POPULATE, map, 0, size); if (ecore_thread_check(thread)) { --