Memory leak in GTK# + Cairo + Pango - memory-leaks

I'm using Mono + GTK# + Cairo + Pango on Ubuntu 12.04 and I found some memory leaks when using a Pango.Layout object.
I'm drawing some animation with a framerate of about 30 fps and my memory only increases. I remove a lot of code and here is what remains:
void OnDraw(DrawingArea area)
{
Cairo.Context context = Gdk.CairoHelper.Create(area.GdkWindow);
using (var lay = Pango.CairoHelper.CreateLayout(context))
{
// Nothing.
}
((IDisposable) context.Target).Dispose();
((IDisposable) context).Dispose();
}
Without the Pango.CairoHelper.CreateLayout call the memory remains stable, but with it increases for about 10k per second which is clearly unacceptable.
Is there something I'm doing wrong? Is Mono + GTK# + Cairo + Pango ready for production?
Mono version : 2.10.8.1-1ubuntu2.2
GTK# version : 2.12.10-2ubuntu4
Pango version : 1.30.0-0ubuntu3.1
uname : Linux ######-VirtualBox 3.2.0-29-generic-pae #46-Ubuntu SMP Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386 GNU/Linux

AFAIK, there have been some fixes in Gtk# bindings that have not been released yet.
For example this memory leak fix.
So if I were you, I would try first with the gtk-sharp upstream version of the 2.12 branch. If that doesn't work, maybe you can spot the memory leak yourself and propose a fix? Thanks.

Related

Regarding QT creator in Lubuntu 16.04 (i386) ICOP board

I have installed qtcreator in lubuntu 16.04 and when trying to open it, i am getting an error
This program requires an x86 processor that supports SSE2 extension, at least a Pentium 4 or newer
Aborted (core dumped)
can someone help me to solve this problem.
I'm using ICOP borad with Lubuntu 16.04
You'll probably need to compile from source with -mno-sse (Or just -mno-sse2 if your CPU has SSE1 but not SSE2). If you're not cross-compiling from a faster machine, use -march=native to enable all the instruction sets your CPU supports, and not enable any that it doesn't.)
The 32-bit qtcreator package probably enables SSE2 on purpose, because detected it and printed an error instead of just dying with a SIGILL. Likely it can be built from source (or the Ubuntu source package) with a different config.
Apparently 32-bit Ubuntu is intended to run on CPUs without SSE2, according to this guide posted in the Ubuntu forums. (It's talking about old desktops with old mainstream CPUs, not modern embedded, but same difference.) So this might be considered a bug.
gcc's 32-bit code-gen does default to assuming cmov support and other P6 (Pentium Pro / Pentium II) instructions, but I guess Ubuntu configures their 32-bit gcc to not enable -msse2 by default. So you couldn't even boot the kernel on a P5 Pentium or older. (Makes sense, if you have SSE2 you probably have an x86-64 capable CPU; running on 32-bit-only CPUs is one of the few reasons for not just using x86-64 Ubuntu. But some people do use 32-bit systems for some reason on modern HW, and gimping it too much by disabling cmov and other P6 new instructions might be undesirable.)
A few years ago (like 2013 maybe?) I booted an Ubuntu live CD on an Athlon XP (SSE1 but not SSE2). It mostly booted to the desktop, but there was a popup from one program that it had died with SIGILL. i.e. it tried to run an SSE2 instruction and got an illegal-instruction exception. I guess this would be considered a but if 32-bit Ubuntu really does aim to support CPUs without SSE2

Android Studio installs only 64 bit executables?

I installed the latest release of Android Studio (2.2.2) on my Ubuntu 32 bits and I found that all the executable are compiled for a 64 bit architecture.
For example:
$>file aapt
aapt: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=b090905d7de6a44b1e136a3d8b819569a6d4f9cb, not stripped
Anybody knows if Android Studio is only released for 64 bit architectures or if there is a specific 32 bit installation link hidden somewhere?
32-bit OSes are not supported.
See the last message in the thread, posted by a Google member:
https://code.google.com/p/android/issues/detail?id=230623
In general we don't support 32-bit Linux distributions, see the "System Requirements" section on https://developer.android.com/studio/index.html.

Linaro ARM toolchain prebuild binaries in 64 bit OS

I have an Ubuntu 14.04 Trusty 64 bit machine. My OS and kernel are all 64 bit
uname -a
Linux --- 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I downloaded the pre-built tool-chain binaries from Linaro as I’m working on something with Raspberry Pi, but I’m unable to compile my code because the binaries that I had downloaded were 32 bit, it is not getting recognized on my 64 bit machine.
Could anyone give me some pointers? (if i can find a 64bit pre-built tool-chain from Linaro) or any other solution that I can deploy on my Ubuntu to workaround the problem
My error as below
some#somemachine:~/tools/compilers/linaro/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin$ file ./arm-none-eabi-gcc-4.9.2
./arm-none-eabi-gcc-4.9.2: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
The file (yeap! its there in the directory)
some#somemachine:~/tools/compilers/linaro/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin$ arm-none-eabi-gcc -v
bash: /home/some/tools/compilers/linaro/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi-gcc: No such file or directory
i found the problem. I had to do little bit of googling.
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
will fix the problem. This will enable 32 bit applications run normally on 64 bit machines + might have to install other *.i386 libraries
AFAICT, Linaro now provides native 64-bit versions of the tool-chain.
For example, the 14.11 release for the bare-metal ABI:
http://releases.linaro.org/14.11/components/toolchain/binaries/arm-none-eabi
http://releases.linaro.org/14.11/components/toolchain/binaries/arm-none-eabi/gcc-linaro-4.9-2014.11-x86_64_arm-eabi.tar.xz

QWidget - Multi Monitor - Single Desktop - X_CopyArea Bug under Ubuntu

I can't figure out what's going on with this Bug i got:
X Error: BadMatch (invalid parameter attributes) 8
Major opcode: 62 (X_CopyArea)
Resource id: 0x4e00004
I wanted to display two widgets on two Monitors with one Application.
I configured my Target with the following screen Configuration (Single Desktop, Multiple Monitors):
Screenshot
Weird is the fact that it works for an old X-Server under Suse. Under Ubuntu it doesn't.
Here are source and X-Versions
Btw:
I must use this config (there must be no virtual Desktop on two screens), and i just want to get why it doesn't work.
- Same dirver
- so qt-bug?
source.zip can be downloaded here
#include <qapplication.h>
#include <qwidget.h>
#include <qdesktopwidget.h>
int
main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget widgetScreenZero(qApp->desktop()->screen(0));
QWidget widgetScreenOne(qApp->desktop()->screen(1));
widgetScreenZero.setStyleSheet("background-image: url(:/images/zero.svg);");l
widgetScreenOne.setStyleSheet("background-image: url(:/images/one.svg);");
widgetScreenOne.show();
widgetScreenZero.show();
return app.exec();
}
+
Suse:
X.Org X Server 1.8.0
Release Date: 2010-04-02
X Protocol Version 11, Revision 0
Build Operating System: openSUSE SUSE LINUX
Current Operating System: Linux ws17 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 i686
Kernel command line: root=/dev/disk/by-id/ata-KINGSTON_SV100S264G_64GB60076281-part1 resume=/dev/disk/by-id/ata-KINGSTON_SV100S264G_64GB60076281-part2 splash=silent quiet crashkernel= vga=0x345
Build Date: 05 July 2010 09:26:26PM
Current version of pixman: 0.18.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
+
Ubuntu:
X.Org X Server 1.14.5
Release Date: 2013-12-12
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.42-37-generic i686 Ubuntu
Current Operating System: Linux ws25 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:42:40 UTC 2014 i686
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.11.0-15-generic root=UUID=ce61481b-be95-4a6b-a5db-1f154dc14cd6 ro quiet splash vt.handoff=7
Build Date: 06 January 2014 01:41:06PM
xorg-server 2:1.14.5-1ubuntu2~saucy1~precise2 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.30.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.

CUDA 5.5 & Intel C/C++ Compiler on Linux

For my current project, I need to use CUDA and the Intel C/C++ compilers in the same project. (I rely on the SSYEV implementation of Intel's MKL, which takes roughly 10 times as long when using GCC+MKL instead of ICC+MKL (~3ms from GCC, ~300µs from ICC).
icc -v
icc version 12.1.5
NVIDIA states, that Intel ICC 12.1 is supported (http://docs.nvidia.com/cuda/cuda-samples/index.html#linux-platforms-supported), but even after having downgraded to Intel ICC 12.1.5 (installed as part of the Intel Composer XE 2011 SP1 Update 3), I am still running into this issue:
nvcc -ccbin=icc src/test.cu -o test
/usr/local/cuda-5.5/bin//..//include/host_config.h(72): catastrophic error: #error directive: -- unsupported ICC configuration! Only ICC 12.1 on Linux x86_64 is supported!
#error -- unsupported ICC configuration! Only ICC 12.1 on Linux x86_64 is supported!
Unfortunately, it seems as if Nvidia is merely tolerating the use of ICC, because I would hardly call it "support", given the lack of information provided by Nvidia for using ICC together with CUDA.
I am running Ubuntu 12.10 x86_64 and CUDA 5.5. Telling icc to mimick the behavior of the stock GCC 4.7.2 using the -Xcompiler -gcc-version=470 option did not help either. Using google/search, I was only able to find threads from the Nvidia forums dealing with CUDA 3.x and Intel ICC 11.1, but I was unable to transfer the obtained information to current CUDA releases.
I would be very grateful for any suggestion on how to solving this issue :-)
Referring to the file referenced in the error you received, it's specifically looking for an ICC compiler with a particular build date:
#if defined(__ICC)
#if !(__INTEL_COMPILER == 9999 && __INTEL_COMPILER_BUILD_DATE == 20110811) || !defined(__GNUC__) || !defined(__LP64__)
#error -- unsupported ICC configuration! Only ICC 12.1 on Linux x86_64 is supported!
#endif
The solution would be to have the intel compiler that actually matches that specified build date. As indicated, ICC 12.1, ie. version 12.1.0.233, instead of ICC 12.1.5 should do the trick.
The narrow focus is at least partly due to a test limitation. In this case, a particular ICC variant was tested with the CUDA toolkit before it was released, and so that host config check has this test in it.
I confronted the problem when compiling madagascar-1.5 with icc2013 and ifort2013. Then I try to resolve the problem by downloading ICC version 2011 update7. Based the INTEL_COMPILER_BUILD_DATE which is 20110811, I can download the correct one. I think the date 20110811 matched icc is the correct one.

Resources