Bug 31090

Summary: cairo-ocaml: Cairo_lablgtk.create causes immense amounts of disk activity
Product: cairo Reporter: Chris King <colanderman>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED MOVED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.10.1   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: OCaml version (shows disk activity)
C program (doesn't exhibit bug)

Description Chris King 2010-10-24 17:35:07 UTC
Created attachment 39748 [details]
OCaml version (shows disk activity)

The attached OCaml program is a simple 100Hz game loop which creates Cairo/Lablgtk contexts.  Using top, it can be seen that this results in the amount of cached filesystem data jumping up 200-300MB (and, depending on system load, causing actual disk activity).  The program itself does not actually use much memory.

This does *not* occur in the equivalent attached C program, leading me to believe the bug is in the OCaml bindings.

Furthermore, it should be noted that the Cairo context which is returned from gdk_cairo_create (which in turn calls cairo_create) is *not* freed upon garbage collection as it should be according to the cairo_create documentation.  Perhaps this is related?  If not, I will open a new bug report.
Comment 1 Chris King 2010-10-24 17:39:33 UTC
Created attachment 39749 [details]
C program (doesn't exhibit bug)

Note that commenting out the line "cairo_destroy(cr)" in paint() results in identical behavior to the OCaml version, lending weight to my memory leak theory.
Comment 2 GitLab Migration User 2018-08-25 13:50:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/223.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.