Pinpointing Resource Usage

workspace
php

#1

I am currently using a free C9 account, but I am having some issue with tracking down why I am constantly getting resource limit errors.

I am coding in PHP with Symfony, when I downloaded the entire code source, including vendors, the extracted file size is only 537MB, however, C9 is reporting that I am using 838MB which is a discrepancy of 300MB.

Another area I’m getting messages is on the memory limit, even with the program stopped and just letting it sit there without typing into the interface it is maxing out the entire 512MB of available RAM. Eventually it will cause a critical error and it will say that “a process exceeded the available memory and was forced to close (python)”. But I am not programming in python, nor do I have any other workspaces open or active at this time.

If I click on the resource monitor at the top of the screen and go to “Show Process List” everything shows 0.00% memory usage and at most 0.5% CPU usage, so I’m not sure where the actual memory usage is coming from.

Is there any way to determine where this memory and storage usage is coming from so that I can free up resources and possibly prevent these error messages from continuing to occur?


#2

Try the top command


#3

Hi @chriscadcw,

Thanks for writing in about this.

When a Cloud9 workspace is created, anything that exists at that time doesn’t count towards your disk quota. However, after that, any and all changes you make, like installing libraries, apt-getting packages, logs, temp files, etc. all count towards your quota. To check which files and folders are using quota, you can run:

$ du-c9 | sort -h

which will print out all the files being counted towards your quota.

Regarding memory issues, at this point, the process list is showing percentages in terms of the entire server (which hosts multiple workspaces). If your workspace only has 512MB of RAM (for example), even 0.5% of a much larger server will cause your workspace to run out of memory.

To diagnose which processes are consuming memory, I would suggest looking for the processes that show > 0% and also checking if the same process is showing up multiple times in the processes list.

I hope this helps.

Regards,
​Mutahhir