question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, I noticed that TorchServe takes up a lot of RAM. This is unexpected, especially as the models run on GPU and take up space there too. In my particular case, I have 2 GPUs and 3 models for a particular inference chain, and nvidia-smi shows that the 3 models x 2 GPUs take approximately 6 GB on the GPUs (i.e. ~ 1 GB per model per GPU). At the same time, htop shows that they are also occupying ~ 12 GB of RAM in total. This should be close to zero as far as I understand. Can anyone please help me understand / resolve this issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:13

github_iconTop GitHub Comments

3reactions
cgnhmtcommented, Feb 14, 2022

Hi does anyone still having this problem?

I have 7 models and serving with the TorchServe. If I load all of them to CPU, in total they consume around 3 gb of RAM. But if I load on GPU, they are using excess amount of the RAM. Only one model consumes around 3gb RAM and If I load all on the GPU they take around 18-20gb. Another interesting thing is that after making an inference, used RAM increases dramatically and stays there. Here is the story:

  • There are 7 models, some of them works paralel. Only one is loaded on GPU.
  • Before an inference, total RAM usage is 3gb
  • During and after inference, total RAM usage is 12gb

Maybe I am doing something wrong with the configurations. I can provide more details.

Here is my config file inference_address=http://0.0.0.0:8080 management_address=http://0.0.0.0:8081 metrics_address=http://0.0.0.0:8082 model_store=/home/model-server/model-store install_py_dep_per_model=false load_models=model1,model2,model3,…,model7 default_workers_per_model=1

Ps. I am using torchserve version 0.4.2 but I tried with the 0.5.2 and it was still same.

Thank you for the help!

1reaction
lxningcommented, Aug 16, 2021

this is fixed in v0.4.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

11 ways to decrease RAM usage and speed up your computer
11 ways to reduce your RAM usage · Turn your device off and on · Check which programs are draining your RAM ·...
Read more >
How to Free Up RAM and Reduce RAM Usage on Windows
1. Restart Your PC · 2. Check RAM Usage With Windows Tools · 3. Uninstall or Disable Unneeded Software · 4. Update Your...
Read more >
10+ Ways to Free up RAM On Your Windows or Mac Device
5 Ways to Free up RAM on Mac · 1. Fix the Finder (Close Finder Windows Too) · 2. Check Activity Monitor ·...
Read more >
How to Check RAM on Windows 10 - Crucial.com
One way to check RAM on Windows 10 and find out your usage is via the “Windows Task Manager.” To consult the Windows...
Read more >
Reducing RAM usage - Untangle Support
Reducing RAM usage · Disable and uninstall memory-intensive applications. · Uninstall disabled applications. · Uninstall applications that are running but have no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found