You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried writing a pretty simple Python client-server application that would pass small structures back and forth, and after seeing all the mention of freeing memory, I decided to take a look at memory usage over the life of the processes. The server process' working set and resident memory sizes grow with every transaction, so I started stripping down what I was sending until I was only sending a string of around 1 KB. Pretty soon I got down to something like this:
for i in range(ITERATION_LIMIT):
if count % ITERATION_REPORT == 0:
report_memory(count)
count += 1
x = proxy.GetData('something')
The report_memory function just documents the memory stats from /proc every 500 passes, and this problem was demonstrable in ps before I added the function. The growth is about 240 bytes for each transaction.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried writing a pretty simple Python client-server application that would pass small structures back and forth, and after seeing all the mention of freeing memory, I decided to take a look at memory usage over the life of the processes. The server process' working set and resident memory sizes grow with every transaction, so I started stripping down what I was sending until I was only sending a string of around 1 KB. Pretty soon I got down to something like this:
And the method in the server proxy is this:
The report_memory function just documents the memory stats from /proc every 500 passes, and this problem was demonstrable in
ps
before I added the function. The growth is about 240 bytes for each transaction.My simple demonstration code is at https://github.com/bajhn/dasbus-demo. Thanks in advance for any insight.
Beta Was this translation helpful? Give feedback.
All reactions