I've checked program with valgrind. It produced hundreds of messages.
It' starts with:
==27551== HEAP SUMMARY:
==27551== in use at exit: 6,339,826 bytes in 16,037 blocks
==27551== total heap usage: 239,607 allocs, 223,570 frees, 63,095,584 bytes allocated
==27551==
==27551== 2 bytes in 1 blocks are possibly lost in loss record 5 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x50F2ED3: g_malloc (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x510B768: g_strdup (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x5121060: g_get_language_names (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x51153F9: g_thread_init_glib (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x50A360D: g_thread_init (in /usr/lib/libgthread-2.0.so.0.2400.1)
==27551== by 0x4CFEAF0: QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*) (qeventdispatcher_glib.cpp:297)
==27551== by 0x427F4CF: QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate() (qguieventdispatcher_glib.cpp:171)
==27551== by 0x427F5C2
: QGuiEventDispatcherGlib
::QGuiEventDispatcherGlib(QObject*) (qguieventdispatcher_glib.
cpp:186) ==27551== by 0x4246454: QApplicationPrivate::createEventDispatcher() (qapplication_x11.cpp:606)
==27551== HEAP SUMMARY:
==27551== in use at exit: 6,339,826 bytes in 16,037 blocks
==27551== total heap usage: 239,607 allocs, 223,570 frees, 63,095,584 bytes allocated
==27551==
==27551== 2 bytes in 1 blocks are possibly lost in loss record 5 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x50F2ED3: g_malloc (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x510B768: g_strdup (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x5121060: g_get_language_names (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x51153F9: g_thread_init_glib (in /lib/libglib-2.0.so.0.2400.1)
==27551== by 0x50A360D: g_thread_init (in /usr/lib/libgthread-2.0.so.0.2400.1)
==27551== by 0x4CFEAF0: QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(_GMainContext*) (qeventdispatcher_glib.cpp:297)
==27551== by 0x427F4CF: QGuiEventDispatcherGlibPrivate::QGuiEventDispatcherGlibPrivate() (qguieventdispatcher_glib.cpp:171)
==27551== by 0x427F5C2: QGuiEventDispatcherGlib::QGuiEventDispatcherGlib(QObject*) (qguieventdispatcher_glib.cpp:186)
==27551== by 0x4246454: QApplicationPrivate::createEventDispatcher() (qapplication_x11.cpp:606)
==27551== by 0x4CD54B8: QCoreApplication::init() (qcoreapplication.cpp:555)
==27551== by 0x4CD5726: QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) (qcoreapplication.cpp:476)
To copy to clipboard, switch view to plain text mode
There are a lot of messages like that above not connected directly with my code. Bu I've found a lot of like this:
[...]
==27551== 24 bytes in 1 blocks are possibly lost in loss record 1,088 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x7EFE9CA: sqlite3MemMalloc (sqlite3.c:12607)
==27551== by 0x7EC92CF: mallocWithAlarm (sqlite3.c:15910)
==27551== by 0x7EC93C7: sqlite3Malloc (sqlite3.c:15938)
==27551== by 0x7F1DF40: unixOpen (sqlite3.c:25494)
==27551== by 0x7EC8CF8: sqlite3OsOpen (sqlite3.c:12229)
==27551== by 0x7EEB2F3: sqlite3BtreeFactory (sqlite3.c:34537)
==27551== by 0x7EF4839: openDatabase (sqlite3.c:96157)
==27551== by 0x4039760
: QSqlDatabase::open() (qsqldatabase.
cpp:842) ==27551== by 0x804C91F: MainWindow::pobierzKomunikaty() (in /home/tomek/projekt/start-build-desktop/start) //important???
==27551== by 0x804E224
: MainWindow
::MainWindow(QWidget*) (in
/home
/tomek
/projekt
/start
-build
-desktop
/start
)
[...]
==27551== 32 bytes in 1 blocks are possibly lost in loss record 1,480 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x7EFE9CA: sqlite3MemMalloc (sqlite3.c:12607)
==27551== by 0x7EC92CF: mallocWithAlarm (sqlite3.c:15910)
==27551== by 0x7EC93C7: sqlite3Malloc (sqlite3.c:15938)
==27551== by 0x7ED6F4B: sqlite3HashInsert (sqlite3.c:19830)
==27551== by 0x7ED8CCC: sqlite3FindCollSeq (sqlite3.c:69693)
==27551== by 0x7EF35DC: createCollation (sqlite3.c:95936)
==27551== by 0x7EF4676: openDatabase (sqlite3.c:96137)
==27551== by 0x4039760
: QSqlDatabase::open() (qsqldatabase.
cpp:842) ==27551== by 0x804C91F: MainWindow::pobierzKomunikaty() (in /home/tomek/projekt/start-build-desktop/start)
==27551== by 0x804E224
: MainWindow
::MainWindow(QWidget*) (in
/home
/tomek
/projekt
/start
-build
-desktop
/start
) ==27551==
==27551== 32 bytes in 1 blocks are possibly lost in loss record 1,481 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x7EFE9CA: sqlite3MemMalloc (sqlite3.c:12607)
==27551== by 0x7EC92CF: mallocWithAlarm (sqlite3.c:15910)
==27551== by 0x7EC93C7: sqlite3Malloc (sqlite3.c:15938)
==27551== by 0x7ED6F4B: sqlite3HashInsert (sqlite3.c:19830)
==27551== by 0x7ED8CCC: sqlite3FindCollSeq (sqlite3.c:69693)
==27551== by 0x7EF35DC: createCollation (sqlite3.c:95936)
==27551== by 0x7EF46FD: openDatabase (sqlite3.c:96143)
==27551== by 0x4039760
: QSqlDatabase::open() (qsqldatabase.
cpp:842) ==27551== by 0x804C91F: MainWindow::pobierzKomunikaty() (in /home/tomek/projekt/start-build-desktop/start)
==27551== by 0x804E224
: MainWindow
::MainWindow(QWidget*) (in
/home
/tomek
/projekt
/start
-build
-desktop
/start
)
[...]
[...]
==27551== 24 bytes in 1 blocks are possibly lost in loss record 1,088 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x7EFE9CA: sqlite3MemMalloc (sqlite3.c:12607)
==27551== by 0x7EC92CF: mallocWithAlarm (sqlite3.c:15910)
==27551== by 0x7EC93C7: sqlite3Malloc (sqlite3.c:15938)
==27551== by 0x7F1DF40: unixOpen (sqlite3.c:25494)
==27551== by 0x7EC8CF8: sqlite3OsOpen (sqlite3.c:12229)
==27551== by 0x7EEB2F3: sqlite3BtreeFactory (sqlite3.c:34537)
==27551== by 0x7EF4839: openDatabase (sqlite3.c:96157)
==27551== by 0x7EC6774: QSQLiteDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) (qsql_sqlite.cpp:533)
==27551== by 0x4039760: QSqlDatabase::open() (qsqldatabase.cpp:842)
==27551== by 0x804C91F: MainWindow::pobierzKomunikaty() (in /home/tomek/projekt/start-build-desktop/start) //important???
==27551== by 0x804E224: MainWindow::MainWindow(QWidget*) (in /home/tomek/projekt/start-build-desktop/start)
[...]
==27551== 32 bytes in 1 blocks are possibly lost in loss record 1,480 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x7EFE9CA: sqlite3MemMalloc (sqlite3.c:12607)
==27551== by 0x7EC92CF: mallocWithAlarm (sqlite3.c:15910)
==27551== by 0x7EC93C7: sqlite3Malloc (sqlite3.c:15938)
==27551== by 0x7ED6F4B: sqlite3HashInsert (sqlite3.c:19830)
==27551== by 0x7ED8CCC: sqlite3FindCollSeq (sqlite3.c:69693)
==27551== by 0x7EF35DC: createCollation (sqlite3.c:95936)
==27551== by 0x7EF4676: openDatabase (sqlite3.c:96137)
==27551== by 0x7EC6774: QSQLiteDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) (qsql_sqlite.cpp:533)
==27551== by 0x4039760: QSqlDatabase::open() (qsqldatabase.cpp:842)
==27551== by 0x804C91F: MainWindow::pobierzKomunikaty() (in /home/tomek/projekt/start-build-desktop/start)
==27551== by 0x804E224: MainWindow::MainWindow(QWidget*) (in /home/tomek/projekt/start-build-desktop/start)
==27551==
==27551== 32 bytes in 1 blocks are possibly lost in loss record 1,481 of 3,561
==27551== at 0x4023C4C: malloc (vg_replace_malloc.c:195)
==27551== by 0x7EFE9CA: sqlite3MemMalloc (sqlite3.c:12607)
==27551== by 0x7EC92CF: mallocWithAlarm (sqlite3.c:15910)
==27551== by 0x7EC93C7: sqlite3Malloc (sqlite3.c:15938)
==27551== by 0x7ED6F4B: sqlite3HashInsert (sqlite3.c:19830)
==27551== by 0x7ED8CCC: sqlite3FindCollSeq (sqlite3.c:69693)
==27551== by 0x7EF35DC: createCollation (sqlite3.c:95936)
==27551== by 0x7EF46FD: openDatabase (sqlite3.c:96143)
==27551== by 0x7EC6774: QSQLiteDriver::open(QString const&, QString const&, QString const&, QString const&, int, QString const&) (qsql_sqlite.cpp:533)
==27551== by 0x4039760: QSqlDatabase::open() (qsqldatabase.cpp:842)
==27551== by 0x804C91F: MainWindow::pobierzKomunikaty() (in /home/tomek/projekt/start-build-desktop/start)
==27551== by 0x804E224: MainWindow::MainWindow(QWidget*) (in /home/tomek/projekt/start-build-desktop/start)
[...]
To copy to clipboard, switch view to plain text mode
And some like this:
==27551== 2,436 (256 direct, 2,180 indirect) bytes in 1 blocks are definitely lost in loss record 3,433 of 3,561
==27551== at 0x4023D47: realloc (vg_replace_malloc.c:476)
==27551== by 0x5270F56: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52719AC: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52720FB: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x527231F: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x5264A27: FcDefaultSubstitute (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x444849A: loadFc(QFontPrivate const*, int, QFontDef const&) (qfontdatabase_x11.cpp:1545)
==27551== by 0x444B8E5
: QFontDatabase::load(QFontPrivate
const*,
int) (qfontdatabase_x11.
cpp:1939) ==27551== by 0x4423C29: QFontPrivate::engineForScript(int) const (qfont.cpp:270)
==27551== by 0x443BD26
: QFontMetricsF::leading() const (qfontmetrics.
cpp:1190)
[...]
==27551== 4,872 (512 direct, 4,360 indirect) bytes in 2 blocks are definitely lost in loss record 3,483 of 3,561
==27551== at 0x4023D47: realloc (vg_replace_malloc.c:476)
==27551== by 0x5270F56: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52719AC: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52720FB: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x527231F: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x5264A27: FcDefaultSubstitute (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x444849A: loadFc(QFontPrivate const*, int, QFontDef const&) (qfontdatabase_x11.cpp:1545)
==27551== by 0x444B8E5
: QFontDatabase::load(QFontPrivate
const*,
int) (qfontdatabase_x11.
cpp:1939) ==27551== by 0x4423C29: QFontPrivate::engineForScript(int) const (qfont.cpp:270)
==27551== by 0x445FC39: QScriptLine::setDefaultHeight(QTextEngine*) (qtextengine.cpp:2009)
==27551== by 0x446F072
: QTextLine::layout_helper(int) (qtextlayout.
cpp:1756) ==27551== by 0x4470F82
: QTextLine::setLineWidth(double) (qtextlayout.
cpp:1601)
[...]
==27551== 2,436 (256 direct, 2,180 indirect) bytes in 1 blocks are definitely lost in loss record 3,433 of 3,561
==27551== at 0x4023D47: realloc (vg_replace_malloc.c:476)
==27551== by 0x5270F56: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52719AC: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52720FB: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x527231F: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x5264A27: FcDefaultSubstitute (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x444849A: loadFc(QFontPrivate const*, int, QFontDef const&) (qfontdatabase_x11.cpp:1545)
==27551== by 0x444B8E5: QFontDatabase::load(QFontPrivate const*, int) (qfontdatabase_x11.cpp:1939)
==27551== by 0x4423C29: QFontPrivate::engineForScript(int) const (qfont.cpp:270)
==27551== by 0x443BD26: QFontMetricsF::leading() const (qfontmetrics.cpp:1190)
==27551== by 0x4359653: qt_format_text(QFont const&, QRectF const&, int, QTextOption const*, QString const&, QRectF*, int, int*, int, QPainter*) (qpainter.cpp:7738)
==27551== by 0x435A695: QPainter::drawText(QRect const&, int, QString const&, QRect*) (qpainter.cpp:5807)
[...]
==27551== 4,872 (512 direct, 4,360 indirect) bytes in 2 blocks are definitely lost in loss record 3,483 of 3,561
==27551== at 0x4023D47: realloc (vg_replace_malloc.c:476)
==27551== by 0x5270F56: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52719AC: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x52720FB: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x527231F: ??? (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x5264A27: FcDefaultSubstitute (in /usr/lib/libfontconfig.so.1.4.4)
==27551== by 0x444849A: loadFc(QFontPrivate const*, int, QFontDef const&) (qfontdatabase_x11.cpp:1545)
==27551== by 0x444B8E5: QFontDatabase::load(QFontPrivate const*, int) (qfontdatabase_x11.cpp:1939)
==27551== by 0x4423C29: QFontPrivate::engineForScript(int) const (qfont.cpp:270)
==27551== by 0x445FC39: QScriptLine::setDefaultHeight(QTextEngine*) (qtextengine.cpp:2009)
==27551== by 0x446F072: QTextLine::layout_helper(int) (qtextlayout.cpp:1756)
==27551== by 0x4470F82: QTextLine::setLineWidth(double) (qtextlayout.cpp:1601)
[...]
To copy to clipboard, switch view to plain text mode
And the final summary looks like this:
==27551== LEAK SUMMARY:
==27551== definitely lost: 2,344 bytes in 11 blocks
==27551== indirectly lost: 11,360 bytes in 568 blocks
==27551== possibly lost: 4,787,191 bytes in 8,606 blocks
==27551== still reachable: 1,538,931 bytes in 6,852 blocks
==27551== suppressed: 0 bytes in 0 blocks
==27551== LEAK SUMMARY:
==27551== definitely lost: 2,344 bytes in 11 blocks
==27551== indirectly lost: 11,360 bytes in 568 blocks
==27551== possibly lost: 4,787,191 bytes in 8,606 blocks
==27551== still reachable: 1,538,931 bytes in 6,852 blocks
==27551== suppressed: 0 bytes in 0 blocks
To copy to clipboard, switch view to plain text mode
I haven't found any message connected directly with code. Functions mentioned in messages I've posted earlier.
Any idea?
thanks in advance
best regards
Tomasz
Bookmarks