Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
for example, does python-based application uses more memory (RAM) than C-based?

What I have tried:

I can't find any of this in google
Posted
Updated 9-Apr-18 6:24am

Generally speaking Python will need more memory than a C based application, but there can be exceptions, in C it is easy to make memory allocation mistakes or forget to dispose objects properly which can cause "memory leaks".
The biggest disadvantage of Python however is that it is slow, see: Is Python faster and lighter than C++? - Stack Overflow[^]
 
Share this answer
 
v2
There are three kinds of language implementations:
  1. Compiled into executable files
  2. Compiled into intermediate (byte) code
  3. Interpreted
In general the total amount of memory increases with the numbering of the above list. The second and third options require also a virtual machine respectively an interpreter loaded into memory that executes the code. While executable applications have some overhead by startup code this is generally much smaller than the VM and interpreters.

Python is a very special case. Depending on the used Python implementation it can be all of the above.

Low level languages like C/C++ have also no automatic range checks which results in smaller code size.

The used data size depends on the performed tasks and should not differ much for similar tasks implemented by different languages. So the used memory upon execution will not differ much when handling large amounts of data.
 
Share this answer
 
Quote:
Does language affects memory consumption of an output program?

Short answer: Yes
Each language have its ups and downs.
Quote:
does python-based application uses more memory (RAM) than C-based?

Generally speaking, with a good programming, a Python program will need more memory and will be slower than a C program. But a Python program will be safer than a C program, said otherwise, speed and small footprint is at expense of safety.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900