ProxymanApp / Proxyman

Modern. Native. Delightful Web Debugging Proxy for macOS, iOS, and Android ⚡️
https://proxyman.io
5.35k stars 177 forks source link

Memory leaks when working for long time #1938

Open nisimjoseph opened 4 months ago

nisimjoseph commented 4 months ago

Description

First thing, thank you for a great product! we have developers working with this product for days, literary days for the ProxyMan is running. while running it loads memory and get to high amount of GB of memory that stuck the Mac.

Steps to Reproduce

  1. run the ProxyMan open for couple of hours or days.

Current Behavior

memory get too high and stuck the mac

Expected Behavior

if the ProxyMan get to a limit of rows, it need to dump the previous ones. for example, I will have default of 5000 lines and after those the 5001 and older will be deleted so the memory will be keep on reasonable range. the UI Preferences need to have the limit set or Unlimited for those who needs it.

Environment

BjornRuud commented 4 months ago

I experienced this too on 4.16.0. I have "Auto Clean Up Resources If Memory Usage Is High" turned on in settings, but over a number of days the Proxyman process used up all the memory.

NghiaTranUIT commented 4 months ago

@BjornRuud it's expected because Proxyman accumulates a lot of traffic for a number of days. You might Click on the Clear Session button to release unnecessary data.

nisimjoseph commented 4 months ago

@NghiaTranUIT yes, but when you leave it off for a day because you didn't remember to turn it off, it gets to 20–40GB of memory usage. That doesn't make sense to me. I think you need to limit the data to 6 hours of accumulation and remove the rest. you can have a setting to make it accumulate forever, but it is supposed to be turned off by default.

NghiaTranUIT commented 4 months ago

@nisimjoseph it depends on how many SSL items are in the Tool menu -> SSL Proxying List. By default, If there are no SSL Entries, Proxyman only proxies the data without holding the body.

If it has some wildcard (e.g. *) or Google Chrome in the SSL Proxying List, Proxyman will decrypt all HTTPS traffic and hold it in memory. So it might consume more RAM.

Can you double check and remove all SSL Entries and test it again for a day?

nisimjoseph commented 4 months ago

@NghiaTranUIT I agree with this, but the Proxy domains are set only to the needed domains. and while developing, we have lots of network calls on our domains. I saw one computer totally stuck because of the 40GB memory the ProxyMan took only by handling our proxy traffic. It occurred to many Frontend developers, including me, because I forgot it open for 10 hours, got to 15GB memory.

NghiaTranUIT commented 4 months ago

May I ask what Proxyman version you're using? From the v4.11.0 (released on Sep 13, 2023), I fixed a memory issue when each request has unnecessary 4 primitive locks => Causing huge memory usage.

nisimjoseph commented 4 months ago

yes, I work with the latest, and I saw the issue in 4.16v as well. I use 5v, and tomorrow I will turn it on all day to check the memory usage for 8 hours.