Comment 3 for bug 1974193

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Testing with the following request in srfsh reveals the memory leak on an unpatched system:

request open-ils.pcrud open-ils.pcrud.search.bre "AUTHTOKEN" {"id":1}, {"flesh":1,"flesh_fields":{"bre":["call_numbers"]}}

Using a script to make that request about 100 times on a test VM running a Concerto dataset on Ubuntu 20.04 causes the pcrud drone's size to increase between 3,000 to 5,000 bytes or there abouts for each time the script is run.

The query from https://bugs.launchpad.net/evergreen/+bug/1974195/comments/2 causes an increase of between 25K and 40K to the pcrud drone each time it is run.

After applying this patch and restarting services, etc., the memory increase is less, particularly after the first run. The srfsh script running the first query 100 times only increase the drone size between 640 and 3,000 bytes, with the highest number after the first time it is run. The second query seems to be less affected by this patch as I saw increases as high as 25K, though it looks like it drops to 6K increases after the first couple of runs.

My testing, both before and after the patch went like this:

1. Start OpenSRF services.
2. pgrep -af pcrud to find the open-ils.pcrud listener and drones.
3. ps -o rsz,vsz $PID_of_pcrud_drone to get the initial size of the drone.
4. Login with srfsh.
5. Replace AUTHTOKEN with the authtoken from the above in a script with the first query in it on 100+ lines.
6. Run the script.
7. Repeat 3 to get the new size of the pcrud drone.
8. Repeat 6 and 7 a few more times.
9. Run the search from bug 1974195 in srfsh
10. Repeat 3.

At one point, a new pcrud drone was spawned, so I did step 3 on both drone PIDs when I became aware of the change. I mainly looked at the rsz number (resident set size) to track changes in the size of the executable.

Since the patch works well enough for me, I've pushed a signoff branch to the working repository: user/dyrcona/lp1974193_fix_memory_leak-signoff.

https://git.evergreen-ils.org/?p=working/OpenSRF.git;a=shortlog;h=refs/heads/user/dyrcona/lp1974193_fix_memory_leak-signoff