news.kde.org: C++ and shared libraries | Linux Today

news.kde.org: C++ and shared libraries

Written By
Web Webster
Web Webster
Sep 20, 2001

From news.kde.org:

“I was recently hired by SuSE to focus on optimizing KDE, and as
part of my work, I have written an analysis of KDE memory usage
based on Waldo Bastian’s previous paper concerning GNU/Linux linker
issues and KDE startup-performance. As it turns out, the linker
issues examined by Waldo do indeed have an effect on the memory
usage of C++ applications compiled and linked under GNU/Linux. The
most important number from this paper: About 650KB of memory wasted
per KDE application not launched via KDE Init.”

[ More links and information on the issue available at news.kde.org.
Analysis linked below. -ed. ]

“In theory, C++ is as efficient (both in memory and
speed) as C, C++ features that have no direct equivalent in C are
as efficient as equivalent hand-written code in C implementing the
same feature, and C++ features that are not used don’t cause any
overhead.

In theory, shared libraries are completely shared by all
programs (processes) using them, without needing any additional
memory – more memory should be needed only if some functionality in
the library is used and is needed for this functionality.

Unfortunately, neither of these two assumptions is true in
practice. When using gcc/GNU ld/glibc in projects like KDE where
large C++ libraries are used, the overhead may become significant,
because of gcc/GNU ld/glibc inefficient handling of large C++
libraries.

In this document, I’ll try to analyze some of the reasons why
large C++ libraries cause so much overhead. Before reading this
document, you should first read Waldo Bastian’s document about
certain linker problems (
http://www.suse.de/~bastian/Export/linking.txt ), which is mainly
aimed at slow startup of applications using large C++ libraries. In
this document, the speed aspects are ignored, as the speed problems
seem to be fixed by a prelink tool that’s under development.
Instead, this document focuses on increased memory usage of
applications using large C++ libraries, caused by these
libraries.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.