[Qt-interest] Crash of my Qt-Application: Could not allocate register file: 12
Gabriel M. Beddingfield
gabrbedd at gmail.com
Tue May 4 20:45:13 CEST 2010
Hi Pedro,
On Tue, 4 May 2010, Pedro Santos wrote:
> Hi,
> my application crashes with the following error:
>
> "Could not allocate register file: 12"
>
> The Crash is induced when I create more than 300-400 objects of a certain class
> (named "Task")
Looks like you're out of memory. Did you actually run out
of memory?? (E.g. you can watch memory usage using 'top'
from a console.)
> QScriptingEngine-Object. I first thought it could be because of running out of
> RAM. But "sizeof(Task)" says that it consumes 40 Bytes of memory. And my System
You can't trust sizeof(Task) because it doesn't account for
memory that was dynamically allocated (using new or
malloc()). This is especially true of Qt objects because
they make liberal use of opaque pointers (aka d-pointers or
"chesire cat"). Using this technique, almost all of your
data for the class is allocated dynamically.
> is a SuSE Linux 11.2, Core i5 (4 Cores) with 4GB of RAM and swap-file
> disabled. On my Laptop (Ubuntu 10.04 Core 2 Duo 3GB RAM, swap-file diabled) it
FYI and off topic: Linus Torvalds once said that your
system runs better with swap enabled... even if you have
ample memory.
-gabriel
More information about the Qt-interest-old
mailing list