# how to get the amount of free memory on a connect port x2

**URL:** <https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315>\
**Category:** Python\
**Tags:** memory-available, connectport-x2\
**Created:** [July 15, 2014, 5:42am UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315 "2014-07-15T05:42:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdehoogh](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mdehoogh](https://forums.digi.com/u/mdehoogh)\
**Post date:** [July 15, 2014, 5:42am UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/1 "2014-07-15T05:42:17Z")

</div>

I want to be able to determine when the amount of free memory is getting low.

---

<div class="post-metadata">

**Author:** ![userid0](https://avatars.discourse-cdn.com/v4/letter/u/f6c823/32.png) [@userid0](https://forums.digi.com/u/userid0)\
**Post date:** [July 15, 2014, 3:16pm UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/2 "2014-07-15T15:16:20Z")

</div>

The “display memory” command from the command line of the gateway will show memory statistics.

---

<div class="post-metadata">

**Author:** ![mdehoogh](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mdehoogh](https://forums.digi.com/u/mdehoogh)\
**Post date:** [July 15, 2014, 4:26pm UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/3 "2014-07-15T16:26:03Z")

</div>

I should have asked: from within python, because I know how to get it using telnet or the web interface to the connect port.

---

<div class="post-metadata">

**Author:** ![16ksa23](https://avatars.discourse-cdn.com/v4/letter/1/aeb1de/32.png) [@16ksa23](https://forums.digi.com/u/16ksa23)\
**Post date:** [July 25, 2014, 1:05am UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/4 "2014-07-25T01:05:50Z")

</div>

I think you need to open a socket at the port 23 and issue the command “display memory” from python. I’m not sure whether this works. I have tried in Java for x4 and it worked for me.

---

<div class="post-metadata">

**Author:** ![mdehoogh](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@mdehoogh](https://forums.digi.com/u/mdehoogh)\
**Post date:** [July 27, 2014, 11:22pm UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/5 "2014-07-27T23:22:22Z")

</div>

Works like a charm. Thx

---

<div class="post-metadata">

**Author:** ![trooper2](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@trooper2](https://forums.digi.com/u/trooper2)\
**Post date:** [July 26, 2014, 5:44am UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/6 "2014-07-26T05:44:14Z")

</div>

You can send an RCI request to the X2 to query the state of the device .

You can then parse the amount of free memory from this response.

---

<div class="post-metadata">

**Author:** ![16ksa23](https://avatars.discourse-cdn.com/v4/letter/1/aeb1de/32.png) [@16ksa23](https://forums.digi.com/u/16ksa23)\
**Post date:** [July 30, 2014, 1:41am UTC](https://forums.digi.com/t/how-to-get-the-amount-of-free-memory-on-a-connect-port-x2/13315/7 "2014-07-30T01:41:37Z")

</div>

As trooper2 mentioned, you can send RCI request from device cloud. You can export the program in python.

Is this the one are you looking for?
