[kstars-devel] analysis of memory consumption

Jason Harris kstars at 30doradus.org
Sun Aug 31 00:51:40 CEST 2003


Greetings,

The "lightweight" dms class is attached as files "small_dms.[h/cpp]".  
The easiest way to incorporate them into KStars is to rename them to 
"dms.[h/cpp]" (you might want to rename the regular dms files first).

No changes to code outside the dms class are required.  Some of the 
functions are not optimal, but the functions used for drawing the sky 
should be fine.  I find that KStars uses 82 MB of system memory when 
using small_dms, and 113 MB when using regular dms.  

Quick analysis:  A SkyPoint using small_dms should be 64 bytes (8 dms 
values, each now only 8 bytes) + 4 bytes for the vtable pointer = 68 
bytes, instead of 288.  I'm guessing the program uses something like 
150,000 SkyPoints total, which is consistent with the observed 
difference in memory usage (150,000*220bytes = about 30 MB).

I will try to do some relative benchmarking of the time taken to draw 
the sky tomorrow after the debian stuff, unless someone else wants to 
give it a shot :).  Just let me know.

regards,
Jason

On Saturday 30 August 2003 10:13 pm, Jason Harris wrote:
> Hi Heiko,
>
> Thank you for the analysis, some very interesting stuff here.
>
> I am working on a "lightweight" version of dms that only stores the
> angle in radians.  All other values are computed on the fly.  We can
> then compare KStars using the two differnet versions and decide which
> is better.  I will post the lightweight dms class to the list when I
> get it working.
>
> regards,
> Jason

-- 
KStars: A KDE Planetarium
http://edu.kde.org/kstars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: small_dms.cpp
Type: text/x-c++src
Size: 7665 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20030830/40db0dd2/small_dms-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: small_dms.h
Type: text/x-chdr
Size: 10141 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kstars-devel/attachments/20030830/40db0dd2/small_dms-0003.bin


More information about the Kstars-devel mailing list