> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ergomake.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing resources

In this page you'll learn how Ergomake handles resource limits within an environment, and how to make better use of the resources available to your preview environments.

## Managing memory quotas

Every Ergomake environment has a memory quota it can use.

<Note>
  To see what are the memory quotas for the free and paid tiers, see our
  [pricing page](https://ergomake.dev/pricing).
</Note>

By default, if you don't determine how much memory each `docker-compose.yml` service needs, Ergomake will split the memory equally between services.

For example, if you have two services and your environment size-limit is one Gi, each service will get 512 Mi.

<Note>
  If the terms `GiB` and `MiB` sound confusing, see [this
  page](https://www.techtarget.com/searchstorage/definition/mebibyte-MiB).
</Note>

To manually split resources across services, you'll have to use [the `resources` attribute within your `docker-compose.yml`](https://docs.docker.com/compose/compose-file/compose-file-v3#resources).

Imagine, for example, that you want to allow your back-end to consume 896 MiB of memory, and you want your front-end to consume the remaining 128 MiB.

In that case, you'd write the following `docker-compose.yml` file.

```yml theme={null}
version: '3.8'
services:
   frontend:
     build:
       context: ./frontend
     ports:
       - "8080:8080"
     resources:
       limits:
         memory: 128Mi

  backend:
    build: ./backend
    ports:
      - '3001:3001'
     resources:
       limits:
         memory: 896Mi
```

Environments whose limits surpass your tier's limit will *not* run.
