Comments (4)
I'll take a look at the sample and figure it out.
On the note of what's going on, I see no obvious retention of memory through classic event handler leaking.
Is this the latest version of gtk-sharp-2-12-branch
?
Few things to note:
- It might not be an actual leak. If the memory goes down after a while, it's just that it's waiting for finalization, since disposal will only release of the native resources.
- StopAnimation doesn't work, since
_idTimer
isnt' set. - Disposing Context.Target is not necessary.
I looked over the methods you're using and their refcounting semantics in gtk#, and they don't seem wrong.
from gtk-sharp.
Thank you as for "StopAnimation doesn't work, since _idTimer isnt' set." I'll fix it
This bug happens on all GTK# versions
As for waiting for finalization I can wait BUT HOW MANY minutes I must wait? Say me quantity of waiting minutes and I will do experience.
Also I would want to pay your attention to this line:
Every time when I redraw this ImageSurface I must create new instance at the begin of method and dispose it at the end of method otherwise if I use one instance again and again my memory also leaks very fast. I think that is not right to create new ImageSurface for every animation step because it is bad performance. Maybe it exists some way to clear this surface without creating new instance
from gtk-sharp.
I'm seeing this when running locally:
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
Set MONO_CAIRO_DEBUG_DISPOSE to track allocation traces
Cairo.Surface is leaking, programmer is missing a call to Dispose
The native memory is not reclaimed in the finalizer for surface. I haven't touched Cairo itself for how it manages native memory, so this is a cairo bug, not a pango bug.
The code you linked here: https://github.com/Rombersoft/pango-sharp-bug/blob/7135ee9a24bd94026ff59dba78c936abb8c95139/Simple_GTK/GraphicsController.cs#L140
The thing with _surface is that you have no guaranteed order of events here. OnDrawn
does not necessarily run right after QueueDraw
is called.
So, what happens is:
- You have a timeout on a 30ms interval
- You keep creating surfaces
- At some point, OnDrawn will run, and you'll only dispose one of them.
So, that means, you should dispose of all the ImageSurfaces you create.
public void FillCommonToBuffer()
{
if (_surface != null)
_surface.Dispose(); // Check this! leaks fixed.
_surface = new ImageSurface(Format.ARGB32, _width, _height);
That made memory stable for me. I also got rid of all the GetTarget().Dispose()
calls everywhere.
from gtk-sharp.
This will not resolve problem with pango.
from gtk-sharp.
Related Issues (20)
- gtk windows x64 binaries
- Gtk.Widget.DeleveEvent is not executed
- Fails to build with Mono 6.4.0 `Range' is an ambiguous reference between `System.Range' and `Gtk.Range' HOT 2
- Gtk.DragFailed with DragResult=NoTarget HOT 1
- Mono.Cecil.Cil; unknown namespace
- Where is ButtonPressEventHandler code?
- release GTK# 3 HOT 8
- Debugging GTK-Warning
- Where is getting started with Gtk.Assistant for GtkSharp 2.x
- Synchronization context doesn't seem to exist, breaking async/await by default. HOT 7
- Docs are down
- Gtk.HTML: type or namespace does not exist in the namespace 'Gtk' HOT 1
- GtkSharp and ProjectReunion: 'GLib.Object' threw an exception when PrintOperation is using HOT 2
- Compile error: ./TestRange.cs(62,13): error CS0030: Cannot convert type `Gtk.VScale' to `System.Range'
- Gtk# 2.12 branch: fixing mono compilation errors
- GTK play VLC video, only sound, no image HOT 1
- Disregard
- Update to GTK4. HOT 2
- avif support in gdk pixbuf HOT 1
- Download link is 404 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtk-sharp.