Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

Memory leak

Open johnrogers opened this issue 2 years ago • 1 comments

Proxyman version? (Ex. Proxyman 1.4.3)

3.8.0

macOS Version? (Ex. mac 10.14)

12.5

Steps to reproduce

Keep the app running for a while

Expected behavior

The app doesn't chew up all of my memory

Screenshots (optional)

image

johnrogers avatar Aug 12 '22 03:08 johnrogers

Thanks. It's a known issue. Just wondering: Do you use * or Google Chrome/Safari on Tool menu -> SSL Proxying List 🤔

Ref: https://docs.proxyman.io/troubleshooting/proxyman-consumes-too-much-ram-and-unresponsive

NghiaTranUIT avatar Aug 12 '22 04:08 NghiaTranUIT

Is there any update on this issue? Seems to also occur when attempting to save captured sessions:

image

matt-wood23 avatar Jan 01 '23 22:01 matt-wood23

Thanks. I'm working on the Export Session v2 to make sure it uses less memory 👍

NghiaTranUIT avatar Jan 02 '23 01:01 NghiaTranUIT

@johnrogers if you don't mind, you can try this Beta build: https://github.com/ProxymanApp/Proxyman/issues/1111#issuecomment-1371882258

NghiaTranUIT avatar Jan 05 '23 07:01 NghiaTranUIT

Similar issue here. I am on Version 4.0.0 (40000)

I am using Proxyman to proxy an iOS simulator with a React Native app to my local web server.

I've spotted a pattern. When the app hits the React server running locally via websockets ws://localhost:9090/ to load the code bundles, I see around 1K request per GB of memory used. See video.

Doesn't seem to happen with regular HTTP proxying, as far as I can tell. And the websocket response is tiny. It is just an upgrade response.

https://user-images.githubusercontent.com/736/212537123-86fb6726-e5ae-48c4-97ca-9b1b7ccb8d5b.mp4

ScreenShot 2023-01-15 at 12 08 56@2x

christos avatar Jan 15 '23 11:01 christos

Port 9090 is listening by Proxyman.

I'm not sure why you want to connect to locahost:9090, which is what Proxyman is listening 🤔

If you'd like to capture the WS traffic, you should connect to your WS server, e.g localhost:3000 (if you have a WS server at port 3000). If you use Google Chrome, it automatically proxies to Proxyman at port 9090.

The issue you reports is a loop issue. I'm going to fix it now 👍

NghiaTranUIT avatar Jan 15 '23 15:01 NghiaTranUIT

Port 9090 is listening by Proxyman.

OK. Then this is weird then. The source of that ws: request seems to be my app running in the iOS simulator as it appears under the Apps section in the sidebar.

I wrongly assumed that the Metro React Native Bundler was the source of those requests. It is not. Metro listens on http://localhost:8081

I'll wait for a build with your loop fix and see if this is what causes the memory leak too.

christos avatar Jan 15 '23 17:01 christos

@johnrogers if you don't mind, you can try this Beta build: #1111 (comment)

Apologies for not getting back to you sooner. Are the fixes above included in 4.0.0? I have to that and I will let you know if the issue occurs again. It has not happened recently but I must admit that I haven't had to use Proxyman very frequently as I haven't been working on much networking stuff.

Thanks. It's a known issue. Just wondering: Do you use * or Google Chrome/Safari on Tool menu -> SSL Proxying List 🤔

Ref: https://docs.proxyman.io/troubleshooting/proxyman-consumes-too-much-ram-and-unresponsive

No *.

johnrogers avatar Jan 15 '23 22:01 johnrogers

Port 9090 is listening by Proxyman.

OK. Then this is weird then. The source of that ws: request seems to be my app running in the iOS simulator as it appears under the Apps section in the sidebar.

I wrongly assumed that the Metro React Native Bundler was the source of those requests. It is not. Metro listens on http://localhost:8081

I'll wait for a build with your loop fix and see if this is what causes the memory leak too.

Can you show me how to reproduce it? I access http://localhost:9090 on web browser, but it doesn't cause the loop.

I'm not sure how to setup the Metro?

NghiaTranUIT avatar Jan 16 '23 08:01 NghiaTranUIT

Can you show me how to reproduce it? I access http://localhost:9090 on web browser, but it doesn't cause the loop.

I am having a hard time reproducing it in a simplified manner. My setup is quite complex. I can't quite tell who accesses ws://loclahost:9090. It seems as it might be the iOS simulator but in the Proxyman Apps list, the source of that request loop is Proxyman itself.

The trigger for the loop is when the React Native app running in the iOS simulator is reloaded and so asks the Metro bundling server for the javascript files it needs. That in theory should be a simple request to http://localhost:8081 and no websockets involved. I am guessing since the requests to http://localhost:8081 go through the macOS proxy, maybe that is what triggers the loop somehow?

I managed to "fix" the bug by changing the proxy port in Proxyman's settings to 9091 — The loop no longer happens. I don't understand why either.

christos avatar Jan 16 '23 09:01 christos