Monitor the QObject Tree of a Qt App
Because it is still reported that the ownCloud Client has an increasing memory footprint when running for long time I am trying to monitor the QObject tree of the client. Valgrind does not report any memory problems with it so my suspicion was that somewhere QObjects are created with valid parent pointers referencing a long living object. These objects might accumulate unexpectedly over time and waste memory.
So I tried to investigate the app with Qt Inspector of Robert Knight. That’s a great tool, but it does not yet completely do what I need because it only shows QWidget based objects. But Robert was kind enough to put me on the right track, thanks a lot for that!
I tried this naive approach:
In the clients main.cpp, I implemented these both callback functions:
[code language=“cpp”] QSet<QObject*> mObjects;
extern “C” Q_DECL_EXPORT void qt_addObject(QObject *obj) { mObjects.insert(obj); }
extern “C” Q_DECL_EXPORT void qt_removeObject(QObject *obj) { mObjects.remove(obj); } [/code]
Qt calls these callbacks whenever a QObject is created or deleted respectively. When the object is created I add it’s pointer to the QSet mObjects, and if it is deleted, it is removed from the QSet. My idea was that after the QApp::exec() call returns, I would have to see which QObjects are still in the mObjects QSet. After a longer run of the client, I hoped to see an artificial amount of objects being left over.
Well, what should I say… No success so far: After first tests, it seems that the amount of left-over objects is pretty constant. Also, I don’t see any objects that I would not kind of expect.
So this little experiment left more questions than answer: Is the suspicion correct that QObjects with a valid parent pointer can cause the memory growth? Is my test code as I did it so far able to detect that at all? Is it correct to do the analysis after the app.exec() call returned?
If you have any hints for me, please let me know! How would you tackle the problem?
Thanks!
This is the link to my modified main.cpp: https://github.com/owncloud/mirall/blob/qobject_monitor/src/main.cpp
The Book
Mission accomplished is a bit of an exaggeration, as you might have suspected. While we had a first version of the book, of course there still is a lot to be added, more content, more structure, more beautiful appearance. But we had quickly settled on the idea that the book shouldn't be a one-time effort, but an on-going project, which grows over time, and is continuously updated as the Frameworks develop, and people find the time and energy to contribute content.
So in addition to writing initial content we spend our thoughts and work on setting up an infrastructure, which will support a sustained effort to develop and maintain the book. While there will come more, having the book on the Kindle to show it around indeed was the first part of our mission accomplished.
Content-wise we decided to target beginning and mildly experienced Qt developers, and present the book in some form of cook book, with sections about how to solve specific problems, for example writing file archives, storing configuration, spell-checking, concurrent execution of tasks, or starting to write a new application.
There already is a lot of good content in our API documentation and on techbase.kde.org, so the book is more a remix of existing documentation spiced with a bit of new content to keep the pieces together or to adapt it to the changes between kdelibs 4 and Frameworks 5.
The book lives in a git repository. We will move it to a more official location a bit later. It's a combination of articles written in markdown and compiling code, from which snippets are dragged into the text as examples. A little bit of tooling around pandoc gives us the toolchain and infrastructure to generate the book without much effort. We actually intend to automatically generate current versions with our continuous integration system, whenever something changes.
While some content now is in the book git repository, we intend to maintain the examples and their documentation as close to the Frameworks they describe. So most of the text and code is supposed to live in the same repositories where the code is maintained as well. They are aggregated in the book repository via git submodules.
Comments and contributions are very welcome. If you are maintaining one of the Frameworks or you are otherwise familiar with them, please don't hesitate to let us know, send us patches, or just commit to the git repository.
I had fun writing some example code and tutorials for creating new applications and how to use KPlotting and KConfig. The group was amazing, and after some struggling with tools, network, and settling on what path to take, there was a tremendous amount of energy, which carried us through days and nights of writing and hacking. This is the magic of KDE sprints. There are few places where you can experience this better than in Randa.
Update: Many people are involved with creating the book, and I'm grateful to everybody who is contributing, even if I haven't mentioned you personally. There is one guy I should have mentioned, though, and that is Bruno Friedmann who made the wonderful cover and always is a source of energy and inspiration.
Announcing first Inqlude alpha release
| Picture by Bruno Friedmann |
I use the tool for creating the web site since quite a while and it works nicely for that. It also can create and check manifest files, which is handy when you are creating or updating these for publication on the web site.
The handling of download and installation of packages of libraries listed on Inqlude is not ready yet. There is some basic implementation, but the meta data needed for it, is not there yet. This is something for a future release.
I put down the plan for the future into a roadmap. This release 0.7 is the first alpha. The second alpha 0.8 will mostly come with some more documentation about how to contribute. Then there will be a beta 0.9, which marks the point where we will keep the schema for the manifest stable. Release 1.0 will then be the point where the Inqlude tool will come with support for managing local packages, so that it's useful for developers writing Qt applications as end users. This plan is not set in stone, but it should provide a good starting point. Longer term I intend to have frequent releases to address the needs reported by users.
You will here more in my lightning talk Everything Qt at Akademy.
Inqlude is one part of the story to make the libraries created by the KDE community more accessible to Qt developers. With the recent first stable release of Frameworks 5, we have made a huge step towards that goal, and we just released the first update. A lot of porting of applications is going on here at the meeting, and we are having discussion about various other aspects how to get there, such as a KDE SDK, how to address 3rd party developers, documentation of frameworks, and more. This will continue to be an interesting ride.
First weeks al Linaro and other things
Core Development Group
You can find more details in the Core Development wiki page, at Linaro Wiki.
Linaro Connect
Factory as a rolling release: openSUSE development version
I would like to specially congratulate Roland Haidl, the Director of Communities at SUSE. The most important (and hardest) thing you can get from a manager is trust, and the openSUSE team had it from him to build a good team, support the changes the team went through back in 2012 (tough times), stand strong behind the new strategy defined in 2013 and support the team during the design and execution of this first milestone. And he did this without making noise, letting the results speak. A management handbook success.
Personal challenges
LinuxCon Europe
Akademy 2014
TEDxLaLaguna
JuliaLang for openSUSE
Now JuliaLang packages are available from Science repository.
- Stable version: OBS page, 1-Click Install
- Git version: OBS page, 1-Click Install
About Julia:
Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library. The library, largely written in Julia itself, also integrates mature, best-of-breed C and Fortran libraries for linear algebra, random number generation, signal processing, and string processing. In addition, the Julia developer community is contributing a number of external packages through Julia’s built-in package manager at a rapid pace.
You can get more information about JuliaLang on official web-site.
Lessons Learnt
It has been a long time and it has been more than 2 years now I have left college. It has been an enriching and humbling experience and has contributed a lot to my personal growth. Let me share a few of them.
- Help is always there, we need to ask for it – On numerous occasions, I have taken help and advice from a lot of people around and away from me. They have become valuable friends over a course of time. In case you need some advice, talk to your parents, friends and even strangers (change the context though :P), you may find meaningful insight.
- Do not hold grudges – We all have good and bad times with people we know. However, as everything in the world is transient, our bad times should not make us hold grudge against them forever. Move On!!!
- Be an optimist – There are times when one might think there are things that cannot be done. Be an optimist, be patient and keep at it, some day you will get the hang of it.
- Be your own (wo)man – Everyone finds someone better than themselves at one point or the other and then we start competing with others. What we usually do not realize is that this competition leads to a cheap imitation of our counterpart. We start losing our own identity and then we are no more ourselves.
openSUSE Asia Summit – How to Help?
openSUSE will host its first Asia Summit at Beihang University in Beijing, China in October. This is the first time the lovely green chameleon will host an event in Asia. This summit has been in the pipeline for a while and will finally see the light of day, thanks to the amazing openSUSE community in China.
To make this event a success, we need a lot of help. If you want to help around with the event, there are many ways to do that.
- If you are into artwork, we require posters, logos and a lot of artwork that goes into the event. There is also a Artwork and Logo contest.
- Submit a Talk/Workshop. This is the mainstay of the conference, and there will be many talks throughout the conference. CfP is open for End User Track, Business Track, Community and Project Track, Technology and Development Track.
- For Django developers, openSUSE is using a voting tool called ‘Snoek’, which was developed during one of the SUSE Hackweeks. Support is needed for adding features like openID support and some more feature enhancements
A big thanks to those who are working round the clock to make the event a great success and to set the bar for future summits. I will keep writing more about the Summit in the weeks to come.
For more information about the summit, the following link can be used
http://summit.opensuse.org/
3d Printer continuum
I am still playing with my Prusa i3 3D printer and hopefully I am a few steps closer to the end. The last few days I ordered some more materials that I did not had and some that I ordered but turned out to be the wrong parts(yeap that happens too when you are a rookie :P ). The good thing is that nowdays the printer actually looks like a printer, the other good thing is that there are not actually wrong parts, it is just the parts for the next one that I will build :) . I also had some time to read a bit more about the wiring and while waiting for the parts to come I will actually work on assembling my heat bed and the power supply. Maybe I will find the courage to program the arduino, although I am avoiding this like hell since I am not confident enough,yet.
Here are some pictures and you cannot see some of the missing parts :D
Let's party!
Yesterday, we released ownCloud 7. You might have read that somewhere on the internet - it was widely announced and broadly picked up. If you do not have ownCloud yet, you really should try it now, and if you are one of the people happily using ownCloud for a while, update soon!
In my opinion, ownCloud 7 is a real step ahead. So much work went into it from the brave server guys, and the result is simply impressive: It is fast, beautiful and fully focused on what it is supposed to be and do: File sync and share, even though you still have of course all the other useful stuff like calendaring and such.
Apart from the wellknown features ownCloud 7 also brings some things that you do not see on the first look. Some of these things relate to syncing and as a guy working mainly on the sync client I am especially happy about that: Already with the current released clients you will see a performance win in syncing, because ownCloud 7 handles parallel HTTP requests way better. Moreover, ownCloud 7 sends some interesting information about it’s files, and the next generation of sync clients will for example know which files are shared and their permissions. We are currently working on some exciting stuff on the client side, stay tuned.

That all should be reason enough to celebrate together, because ownCloud is done by all of us in the community.
On Tuesday, august 5th, we will do a Release Party in Nuremberg, Germany. As last time, the Coworkingspace Nürnberg is hosting us. We will start at 18:00.
Everybody who is interested in ownCloud for whatever reason is very welcome to show up. We will probably have a short informal demonstration or two, but of course plenty room for questions, discussions, meet and greet with all kind of FOSS people, some core ownCloud people, nice beer and big fun.
You really should come! And don’t forget to tell your friends, thanks!
Sara Golemon (Facebook) announces PHP Language Specification for OSCON 2014
For more than 10 years, PHP core developers repeatedly raised the topic of providing a formal language specification for PHP. Now a team of facebook employees has written such a specification. The spec document is currently only available as a preview chapter a preview chapter . PHP veteran Sara Golemon announced on the “PHP internals” list that the full document will be ready for O’Reilly’s OSCON 2014. Sara Golemon published the standard book on “Extending and Embedding PHP” some years ago and now works for Facebook’s own PHP implementation HHVM. The PHP spec defines PHP version 5.6 in about 200 pages and contains all the odd and obscure quirks of the language core. Facebook’s own HHVM aims to be as close to the spec as possible. Currently, PHP developers discuss how amending the spec can become a mandatory part of the language development process. Though some are sceptic that all developers will embrace the change in the process, everybody on the list was happy to have the new document.
Software Architect Stas Malyshev:
Thank you Sara and Facebook team for doing something we’ve been talking
about for more than a decade and before that nobody actually attempting
to do. I think it is a great development and I hope to see the first
version soon.
http://dl.hhvm.com/resources/PHPSpec-SneakPeak.pdf







