# class memory usage

**URL:** <https://forum.xojo.com/t/class-memory-usage/33548>\
**Category:** General\
**Created:** [September 22, 2016, 7:51am UTC](https://forum.xojo.com/t/class-memory-usage/33548 "2016-09-22T07:51:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano\_Basile](https://forum.xojo.com/user_avatar/forum.xojo.com/stefano_basile/32/1487_2.png) [@Stefano\_Basile](https://forum.xojo.com/u/Stefano_Basile)\
**Post date:** [September 22, 2016, 7:51am UTC](https://forum.xojo.com/t/class-memory-usage/33548/1 "2016-09-22T07:51:47Z")

</div>

hello all, i need to know if the “Runtime.memoryusage” returns me all memory usage or just that of a single allocated object? i need to know only the memory usage of a single class

thank you in advance

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [September 22, 2016, 8:36am UTC](https://forum.xojo.com/t/class-memory-usage/33548/2 "2016-09-22T08:36:43Z")

</div>

Runtime.MemoryUsed is the current used memory of the app. You could possibly find the size of an instance of a class by comparing the memory used before creating the instance and after it is created. However if any one property is a string, memory block or other variable sized object then the size of the instance will change.

Perhaps you need something like a structure [http://documentation.xojo.com/index.php/Structure](http://documentation.xojo.com/index.php/Structure) where you define the size/type of the data?

---

<div class="post-metadata">

**Author:** ![Stefano\_Basile](https://forum.xojo.com/user_avatar/forum.xojo.com/stefano_basile/32/1487_2.png) [@Stefano\_Basile](https://forum.xojo.com/u/Stefano_Basile)\
**Post date:** [September 22, 2016, 9:03am UTC](https://forum.xojo.com/t/class-memory-usage/33548/3 "2016-09-22T09:03:17Z")

</div>

specifically i need the class memory usage while running

---

<div class="post-metadata">

**Author:** ![Eli\_Ott](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/5f8ce5/32.png) [@Eli\_Ott](https://forum.xojo.com/u/Eli_Ott)\
**Post date:** [September 22, 2016, 9:04am UTC](https://forum.xojo.com/t/class-memory-usage/33548/4 "2016-09-22T09:04:34Z")

</div>

Why? Usually this doesn’t matter, so it would be good to hear the specific case you have.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:28pm UTC](https://forum.xojo.com/t/class-memory-usage/33548/5 "2020-10-29T18:28:28Z")

</div>


