# memory and cpu usage

**URL:** <https://forums.digi.com/t/memory-and-cpu-usage/5935>\
**Category:** NET+OS\
**Created:** [August 16, 2005, 1:32pm UTC](https://forums.digi.com/t/memory-and-cpu-usage/5935 "2005-08-16T13:32:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gjgowey](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@gjgowey](https://forums.digi.com/u/gjgowey)\
**Post date:** [August 16, 2005, 1:32pm UTC](https://forums.digi.com/t/memory-and-cpu-usage/5935/1 "2005-08-16T13:32:57Z")

</div>

Does anyone know how to determine the memory usage of different processes and how much is available? Also, how can the CPU usage be determined?

---

<div class="post-metadata">

**Author:** ![uniton](https://avatars.discourse-cdn.com/v4/letter/u/5daacb/32.png) [@uniton](https://forums.digi.com/u/uniton)\
**Post date:** [August 19, 2005, 1:50pm UTC](https://forums.digi.com/t/memory-and-cpu-usage/5935/2 "2005-08-19T13:50:48Z")

</div>

GreenHills Multi2000 has a good tool to view the state of the OS. It includes dialogues for all threads, timers, semaphores and so on…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/digi/original/1X/11da31a6a1fbcd03ef21d3f785c317c824009ae2.png) [@system](https://forums.digi.com/u/system)\
**Post date:** [August 31, 2005, 1:20pm UTC](https://forums.digi.com/t/memory-and-cpu-usage/5935/3 "2005-08-31T13:20:35Z")

</div>

To measure the CPU load I use a very low priority thread and let it run full speed just incrementing an integer. then every 10 seconds I check how high it counted. The higher it counts, the less load on the cpu. To determine the maximum it will count to at 0 load, let it be the only thread and just see how high it goes. Hope this helps

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/digi/original/1X/11da31a6a1fbcd03ef21d3f785c317c824009ae2.png) [@system](https://forums.digi.com/u/system)\
**Post date:** [September 5, 2005, 4:34pm UTC](https://forums.digi.com/t/memory-and-cpu-usage/5935/4 "2005-09-05T16:34:52Z")

</div>

To find out memory-usage I do a loop with allocating memory in blocks of 256 K. When malloc() fails, i approximatly know how much is available. After that don’t forget to free all memory blocks again 😉
