evince and linux-embedded devices



Dear developers of evince.

There is a problem in using evince and linux-embedded device Nokia n810
http://europe.nokia.com/n810 . This device has only 128 Mb RAM . Evince
consumes a lot of memory when open some pdf files and as a result it's
got killed my OOM killer.  An example of such file is here:
http://www.macs.hw.ac.uk/~ruth/ICAPSWorkshop/paper2.pdf
This file has very big image (more 90Mb) on third page.After opening
this file evince consumes a lot of memory.
The evince (IMHO) does not corrected work with memory.
The reason of this could be that evince allocated two blocks of memory
for the same.
To catch the issue I used valgrind with options: --tool=massif --depth=50
valgrind --tool=massif --depth=50 evince -p 3 paper2.pdf
for diagnostic problem.
Please find the report file attached (massif.out.29236). You can view it
using ms_print utility from valgrind.
This report shows double allocation of memory for image.
What do you think is it really double memory allocation issue or not?
I also prepared fix for that and it worked for me on N810 just fine.
But I'm still not sure if it's 100% correct. I'd really appreciate if
you look at the attached patch and tell me if it's correct or not.


Regard,
Vlad Vasiliev

Attachment: massif.out.29236.gz
Description: application/gzip

Index: ev-jobs.c
===================================================================
--- ev-jobs.c	(revision 36)
+++ ev-jobs.c	(working copy)
@@ -403,10 +403,15 @@
 			job->form_field_mapping =
 				ev_document_forms_get_form_fields (EV_DOCUMENT_FORMS (EV_JOB(job)->document),
 								   job->rc->page);
-		if (job->include_images && EV_IS_DOCUMENT_IMAGES (EV_JOB (job)->document))
-			job->image_mapping =
-				ev_document_images_get_images (EV_DOCUMENT_IMAGES (EV_JOB (job)->document),
-							       job->rc->page);
+		EvDocumentInfo  *ev_d_info;
+		ev_d_info = ev_document_get_info(EV_DOCUMENT(EV_JOB(job)->document)); 
+		
+		if (!ev_d_info->format || ev_d_info->format && strncasecmp("pdf",ev_d_info->format,3) != 0)
+		    if (job->include_images && EV_IS_DOCUMENT_IMAGES (EV_JOB (job)->document))
+			    job->image_mapping =
+				    ev_document_images_get_images (EV_DOCUMENT_IMAGES (EV_JOB (job)->document),
+							        job->rc->page);
+							       
 		EV_JOB (job)->finished = TRUE;
 	}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]