Serving: VIRTUAL MEMORY EXHAUSETED

Created on 28 Mar 2017  路  3Comments  路  Source: tensorflow/serving

Hi I tried to install tensor flow serving using docker
After running this bazel build -c opt tensorflow_serving/... got an error
virtual memory exhausted
image
PLEASE HEP ME OUT WITH THIS

Most helpful comment

Hi,

The tensorflow serving build is memory intensive. I normally build in a Docker container and in my Docker for Mac configuration, I allocate 12GB for the Docker VM. I do not know how much RAM is minimally needed to do a build. This is likely somewhere around the edge as, sometimes, I'll get a successful build with the build command specified in the documentation. Often, I don't get a successful build, so I use a more conservative set of arguments for the build.

bazel build --jobs 1 --local_resources 10000,1.0,1.0 --verbose_failures tensorflow_serving/...

It looks like you failed in the compile stage, so you may not have enough RAM. But, adjust the 10000 (10GB) to be lower than the amount of RAM you have available. Although, the compile stage is fairly good at automatically staying within the amount of RAM you have available.

There is a tendency for the build to fail towards the end of the linking stages. In the last stage the automatic adjustments don't seem to work. The issue is, the last part of the linking is using so much memory that the build process exhausts the memory, before the build can do whatever it would do to try to reduce the memory usage. For that case I specify jobs=1. Hope this helps.

All 3 comments

Hi,

The tensorflow serving build is memory intensive. I normally build in a Docker container and in my Docker for Mac configuration, I allocate 12GB for the Docker VM. I do not know how much RAM is minimally needed to do a build. This is likely somewhere around the edge as, sometimes, I'll get a successful build with the build command specified in the documentation. Often, I don't get a successful build, so I use a more conservative set of arguments for the build.

bazel build --jobs 1 --local_resources 10000,1.0,1.0 --verbose_failures tensorflow_serving/...

It looks like you failed in the compile stage, so you may not have enough RAM. But, adjust the 10000 (10GB) to be lower than the amount of RAM you have available. Although, the compile stage is fairly good at automatically staying within the amount of RAM you have available.

There is a tendency for the build to fail towards the end of the linking stages. In the last stage the automatic adjustments don't seem to work. The issue is, the last part of the linking is using so much memory that the build process exhausts the memory, before the build can do whatever it would do to try to reduce the memory usage. For that case I specify jobs=1. Hope this helps.

I had the same problem, @mountaintom 's solution worked for me!

@mountaintom's solution to limit Bazel's usage seems right and we've used it to fix other issues related to resource constraints in the past.

Was this page helpful?
0 / 5 - 0 ratings