0

I am using OpenCV + deep neural network for object detection. I am using python language.

I want to run the code on some embedded system platform (like Raspberry Pi for example). I want to know whether my code will run or not on the embedded system platform. Right now I am running the code on my laptop which has large memory.

I want to first know how much my code is consuming memory at run time. After that I will choose hardware containing sufficient RAM.

So how can I know the run time memory consumption of my python code? Any extra tips or opinions will also be appreciated.

EDIT: I am using Ubuntu Linux.

Syed Waris
  • 1,056
  • 1
  • 11
  • 16
  • 1
    Unless you have a crystal ball it’s not possible to predict With any plausible accuracy how much memory your application will need. You might be able to build in some dynamic assessment of memory usage and make your code adopt different strategies? Also it’s difficult to regard a Pi as an “embedded system”: it’s a traditional desktop-style environment in a very small package and at a low price. – DisappointedByUnaccountableMod Feb 14 '20 at 22:21
  • 1
    Compared to many embedded systems (and even many embedded Linux systems) RPi has a _huge_ memory. If it has enough memory to run Linux and support full Python (as opposed to Python-like subsets such as MicroPython), and OpenCV (and its Python bindings), then it is hardly typical of most embedded systems. I would argue that RPi is not specifically an _embedded system platform_. It is small, cheap, sold as a bare board and has basic GPIO, so can be embedded, but it was hardly designed for that purpose. – Clifford Feb 15 '20 at 02:07
  • 1
    A possibly simpler method that that described in the marked duplicate: https://unix.stackexchange.com/questions/375889/unix-command-to-tell-how-much-ram-was-used-during-program-runtime. – Clifford Feb 15 '20 at 02:14

0 Answers0