Author Topic: What is PI using 1.2GB RAM for?  (Read 4317 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
What is PI using 1.2GB RAM for?
« on: 2009 August 30 10:51:35 »
Hi,

I've had PI running for a while, processing and re-processing my M31 image. I have 1 6MP color image and a 6MP B/W image loaded. Two small color images that aggregated some previews for color calibration. 4 Whole image previews of the color image. That's it. Seems like PI is a little memory hungry right now. Anything I can do to find out where it's getting used? I have plenty of memory on my system but that's not the point :) I still want my software to use resources efficiently.

Thanks,

  Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: What is PI using 1.2GB RAM for?
« Reply #1 on: 2009 September 05 02:47:04 »
Hi Sander,

To get system memory usage statistics, enter this in PI's command line:

memory

I don't know why Windows is telling you that PI is consuming much more memory than you actually have allocated. I'll investigate this thoroughly as soon as I have a (virtual, of course) running Windows machine to make the required tests (the old PIV is not an option <g>).

What I can tell you for sure is that this does not happen on Linux and Mac OS X. The last tests on Linux showed that there is no significant memory leaks in PixInsight. There are only minor leaks totalizing about 600 KB after a heavy test session. Except Qt and very small platform-specific sections (mostly related to color management), the code is exactly the same on all platforms. Another thing I can tell is that memory management on Windows is somewhat peculiar (from my experience at least). I think the problem isn't only with Windows, but also with how VC++ runtime libraries perform dynamic memory allocation/management.

You can make a simple test. When you find yourself in a situation as you've described, create a very big image, for example one that needs 1.5 or 2 GB of RAM, then duplicate it. Now you have 3 or 4 GB of your 6 GB allocated in PI, plus the small amount of RAM allocated for your real images. Now close both huge images and recalculate the amount of memory used by PI (on the task manager I suppose). This usually performs a sort of internal "re-package" that frees most of the memory previously allocated.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: What is PI using 1.2GB RAM for?
« Reply #2 on: 2009 September 05 07:17:34 »
I'll use the memory command next time and see what's up. I see a lot of hints that you don't use windows as your primary platform anymore. That's cool but please don't forget that's where the majority of your customers are. At least according to the informal poll I posted some time back.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: What is PI using 1.2GB RAM for?
« Reply #3 on: 2009 September 05 16:51:56 »
Hi Sander,

My primary platform is Linux x86_64. PixInsight's primary development platform is also Linux. It means just that everything is developed and tested day-to-day on Linux, then transported to Mac OS X and Windows, where it is thoroughly tested. Thanks to the Qt library, portability is guaranteed for the whole GUI and all system-dependent code. All image-processing code, including PCL, is 100% portable.

Of course I don't forget that most PI users are Windows users; I would be extremely irresponsible if I'd do that. However, the fact that PI is being developed primarily on Linux must not be seen as a problem or a limitation for the Windows port. On the contrary, PixInsight is much more stable and consistent since it is being developed primarily as a Linux application. From my experience, the more platforms we cover, the better is the whole product. This has happened with the addition of Mac OS X. Sun's Solaris will perhaps be the next target platform for PixInsight (next year, probably). Diversity is definitely very good for PixInsight :)

Perhaps the fact that I run Windows on virtual machines is also seen as something negative. What happens is just the contrary: the Windows port is better since I run Windows exclusively on virtual machines. Virtual machines allow me to share code and test images much more easily among different OS's inside a single workstation. Virtual machines are much cheaper than physical ones, they provide more flexibility, and facilitate maintenance. Unfortunately, Mac OS X cannot be run (legally) on non-Apple hardware. No problem though, since I really love my Mac Pro, which I operate remotely through SSH from Linux most of the time ;D
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: What is PI using 1.2GB RAM for?
« Reply #4 on: 2009 September 22 18:34:30 »
Hi Juan,

I finally got around to trying that command. I don't think it shares anything relevant:

memory
Total physical memory .......   6134.199 MB
Available physical memory ...   3037.496 MB ( 49.52%)
Total paged memory ..........  12465.934 MB
Available paged memory ......   8820.594 MB ( 70.76%)

It merely talks about OS memory, not about what PI uses. I was interested to know what it was using memory for as it consumed more than 200MB memory after I closed all images and deleted all icons. When I restarted PI it used less than half that (90 MB). My system can certainly stand it but I'd still like to know if that's expected behavior.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity