# OOM during bulk loading

**URL:** <https://discuss.dgraph.io/t/oom-during-bulk-loading/15725>\
**Category:** Dgraph\
**Tags:** bulkloader\
**Created:** [October 5, 2021, 11:21am UTC](https://discuss.dgraph.io/t/oom-during-bulk-loading/15725 "2021-10-05T11:21:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Naman](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/naman/32/3498_2.png) [@Naman](https://discuss.dgraph.io/u/Naman)\
**Post date:** [October 6, 2021, 12:42pm UTC](https://discuss.dgraph.io/t/oom-during-bulk-loading/15725/2 "2021-10-06T12:42:11Z")

</div>

Hey @keks51 , bulk loader exposes an http port to debug. You can take heap profile with a command that should look like:

```auto
go tool pprof localhost:8080/debug/pprof/heap

```

It will print out the destination:

```auto
Fetching profile over HTTP from http://localhost:8080/debug/pprof/heap
Saved profile in /home/dg/pprof/pprof.dgraph.alloc_objects.alloc_space.inuse_objects.inuse_space.003.pb.gz
File: dgraph
Build ID: a05419818fad7662cc49992bb9b39ae4426199ad
Type: inuse_space
Time: Oct 6, 2021 at 5:39am (PDT)
Entering interactive mode (type "help" for commands, "o" for options)

```

Heap profiles will help us debug the issue.  
Also, please collect the jemalloc profile as well.

```auto
dg@machine:~$ curl localhost:8080/jemalloc
Num Allocated Bytes: 6.7 GiB [7235175716]
Allocators:
Tag: Reducer.ToList Num: 1 Size: 4.0 GiB . Tag: Builder Num: 1 Size: 384 MiB . 
Allocations:
4.0 GiB at file: Reducer.ToList
260 MiB at file: Reducer.Buffer.ToList
2.1 GiB at file: Reducer.GetBuf
128 MiB at file: TableBuilder
256 MiB at file: Builder

```

---

_[View the full topic](https://discuss.dgraph.io/t/oom-during-bulk-loading/15725)._
