[GH-ISSUE #1111] Saving session takes too much memory #1108

Open
opened 2026-03-03 19:48:25 +03:00 by kerem · 12 comments
Owner

Originally created by @CyberMew on GitHub (Jan 14, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1111

Originally assigned to: @NghiaTranUIT on GitHub.

I was trying to save a session and it went as high as 80GB and I had to terminate it, losing all my data.

Is it possible to:

  1. add cancellation in the progress window.
  2. estimate the size required and check the disk space, prompt for warning first. then write to file in chunks periodically (newest records first) instead of saving all to memory. this way even if it crashes there is still something usable.
Originally created by @CyberMew on GitHub (Jan 14, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1111 Originally assigned to: @NghiaTranUIT on GitHub. I was trying to save a session and it went as high as 80GB and I had to terminate it, losing all my data. Is it possible to: 1. add cancellation in the progress window. 2. estimate the size required and check the disk space, prompt for warning first. then write to file in chunks periodically (newest records first) instead of saving all to memory. this way even if it crashes there is still something usable.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 14, 2022):

Do you remember what the latest ID number is? Or how long the session you've used? I would like to estimate how It can be generated as 80GB.

<!-- gh-comment-id:1012779880 --> @NghiaTranUIT commented on GitHub (Jan 14, 2022): Do you remember what the latest ID number is? Or how long the session you've used? I would like to estimate how It can be generated as 80GB.
Author
Owner

@CyberMew commented on GitHub (Jan 14, 2022):

Sorry, unfortunately I don't remember at all, but for what's it worth my laptop has been up for 9 days and it tracks the network for my laptop and my phone. I was also surprised by the size the app was eating. Maybe there is a loop causing a leak somewhere? Regardless, I think it would be good to have point 1 and 2.

<!-- gh-comment-id:1012787407 --> @CyberMew commented on GitHub (Jan 14, 2022): Sorry, unfortunately I don't remember at all, but for what's it worth my laptop has been up for 9 days and it tracks the network for my laptop and my phone. I was also surprised by the size the app was eating. Maybe there is a loop causing a leak somewhere? Regardless, I think it would be good to have point 1 and 2.
Author
Owner

@CyberMew commented on GitHub (Mar 5, 2022):

Since 21st Feb:
CleanShot 2022-03-05 at 10 24 48@2x
I would be happy to test it again, but I am pretty sure (like all my bug reports that have been valid so far) that this hang will happen again and the save will fail, and I need my requests to be around. Are you not able to replicate it on your side?

<!-- gh-comment-id:1059655630 --> @CyberMew commented on GitHub (Mar 5, 2022): Since 21st Feb: <img width="71" alt="CleanShot 2022-03-05 at 10 24 48@2x" src="https://user-images.githubusercontent.com/4715911/156864249-22b62a9d-68d0-48b2-9620-576c2bf8408f.png"> I would be happy to test it again, but I am pretty sure (like all my bug reports that have been valid so far) that this hang will happen again and the save will fail, and I need my requests to be around. Are you not able to replicate it on your side?
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 5, 2022):

yes, I'm able to reproduce on my side. The problem is I could not find a better solution to reduce the RAM usage.

To clarify, the session is huge (150k items, and might be fully decrypted). Thus, it requires more RAM to serialize to JSON and zip it.

<!-- gh-comment-id:1059660588 --> @NghiaTranUIT commented on GitHub (Mar 5, 2022): yes, I'm able to reproduce on my side. The problem is I could not find a better solution to reduce the RAM usage. To clarify, the session is huge (150k items, and might be fully decrypted). Thus, it requires more RAM to serialize to JSON and zip it.
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 5, 2022):

I highly suggest that you should only save a domain that you're working on. By right-clicking on the domain node on the left panel -> Export -> Proxyman Log, rather than trying to save entire the Session.

<!-- gh-comment-id:1059660803 --> @NghiaTranUIT commented on GitHub (Mar 5, 2022): I highly suggest that you should only save a domain that you're working on. By right-clicking on the domain node on the left panel -> Export -> Proxyman Log, rather than trying to save entire the Session.
Author
Owner

@CyberMew commented on GitHub (Mar 5, 2022):

Glad you are able to replicate it. Having a progress window (UI not blocked) that shows the progress (while terminate-able) would be good. Processing it in limited chunks would be more manageable than dumping the whole thing to memory.

Thanks for the workaround suggestion, I will attempt to only export my pinned domain. May I know what is the difference between outputting as Proxyman Log vs Proxyman? And can it be restored in a future session of Proxyman if I quit the app?

<!-- gh-comment-id:1059672693 --> @CyberMew commented on GitHub (Mar 5, 2022): Glad you are able to replicate it. Having a progress window (UI not blocked) that shows the progress (while terminate-able) would be good. Processing it in limited chunks would be more manageable than dumping the whole thing to memory. Thanks for the workaround suggestion, I will attempt to only export my pinned domain. May I know what is the difference between outputting as Proxyman Log vs Proxyman? And can it be restored in a future session of Proxyman if I quit the app?
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 5, 2022):

Basically, ProxymanLog and ProxymanSession are the same. When you export it, you can import it later.

ProxymanSession contains all domain/app nodes, so it generally is huge than ProxymanLog, which is for a particular node.

<!-- gh-comment-id:1059673347 --> @NghiaTranUIT commented on GitHub (Mar 5, 2022): Basically, ProxymanLog and ProxymanSession are the same. When you export it, you can import it later. ProxymanSession contains all domain/app nodes, so it generally is huge than ProxymanLog, which is for a particular node.
Author
Owner

@CyberMew commented on GitHub (Mar 16, 2022):

Just exported a domain and it basically went up to 40+GB of RAM using ProxymanLog. It was previously only 1GB+ iirc. Not sure how it can exceed 40GB+ but is it possible to make it such that it doesn't push the whole thing into memory eating into swap memory and instead do the processing piecewise? It makes the whole laptop lag when I export. I'd rather Proxyman process the export a bit slower and make the laptop usable, process cancel-able, with progress bar.

CleanShot 2022-03-16 at 16 12 31@2x

I also had to force quit the app because there is no way for me to cancel the operation and basically either lose the whole session or have all my other apps force close. As of now export is not very usable at all. Rather frustrating.

<!-- gh-comment-id:1068872303 --> @CyberMew commented on GitHub (Mar 16, 2022): Just exported a domain and it basically went up to 40+GB of RAM using ProxymanLog. It was previously only 1GB+ iirc. Not sure how it can exceed 40GB+ but is it possible to make it such that it doesn't push the whole thing into memory eating into swap memory and instead do the processing piecewise? It makes the whole laptop lag when I export. I'd rather Proxyman process the export a bit slower and make the laptop usable, process cancel-able, with progress bar. ![CleanShot 2022-03-16 at 16 12 31@2x](https://user-images.githubusercontent.com/4715911/158545814-453453a6-327b-42a1-a7e9-a636fa9dcac5.png) I also had to force quit the app because there is no way for me to cancel the operation and basically either lose the whole session or have all my other apps force close. As of now export is not very usable at all. Rather frustrating.
Author
Owner

@matt-wood23 commented on GitHub (Jan 1, 2023):

+1 also seeing the same issue and unable to export my sessions, even when just exporting selected / filtered sessions.

@NghiaTranUIT has there been any progress on resolving this and #1330 ? Both issues are many months old now.

<!-- gh-comment-id:1368555721 --> @matt-wood23 commented on GitHub (Jan 1, 2023): +1 also seeing the same issue and unable to export my sessions, even when just exporting selected / filtered sessions. @NghiaTranUIT has there been any progress on resolving this and #1330 ? Both issues are many months old now.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 2, 2023):

Thanks @matt-wood23. We've recently received similar reports on the Export Session feature, which causes the app unresponsive.

I'm working on the v2 now and making sure it would consume less memory.

<!-- gh-comment-id:1368591684 --> @NghiaTranUIT commented on GitHub (Jan 2, 2023): Thanks @matt-wood23. We've recently received similar reports on the Export Session feature, which causes the app unresponsive. I'm working on the v2 now and making sure it would consume less memory.
Author
Owner

@matt-wood23 commented on GitHub (Jan 3, 2023):

Thanks @NghiaTranUIT - appreciate all the great work.

<!-- gh-comment-id:1370286501 --> @matt-wood23 commented on GitHub (Jan 3, 2023): Thanks @NghiaTranUIT - appreciate all the great work.
Author
Owner

@NghiaTranUIT commented on GitHub (Jan 5, 2023):

Hey @matt-wood23 @CyberMew, let's try this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.15.0_Better_Proxyman_Session_V2.dmg

This version would introduce the proxymansessionv2 that:

  • Significantly reduce the file size (80% size)
  • Remove all duplicated requests/responses in the Tree (it's the problem of the proxymansessionv1)
  • Fix: Memory Leak & unresponsive.
<!-- gh-comment-id:1371882258 --> @NghiaTranUIT commented on GitHub (Jan 5, 2023): Hey @matt-wood23 @CyberMew, let's try this Beta build: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.15.0_Better_Proxyman_Session_V2.dmg This version would introduce the `proxymansessionv2` that: - Significantly reduce the file size (80% size) - Remove all duplicated requests/responses in the Tree (it's the problem of the `proxymansessionv1`) - Fix: Memory Leak & unresponsive.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1108
No description provided.