# dada2 system call failed: Cannot allocate memory

**URL:** https://forum.qiime2.org/t/dada2-system-call-failed-cannot-allocate-memory/10844
**Category:** Technical Support
**Created:** [July 25, 2019, 8:38pm UTC](https://forum.qiime2.org/t/dada2-system-call-failed-cannot-allocate-memory/10844 "2019-07-25T20:38:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ebriese](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebriese/32/5354_2.png) [@ebriese](https://forum.qiime2.org/u/ebriese)
#### Post date: [July 25, 2019, 8:38pm UTC](https://forum.qiime2.org/t/dada2-system-call-failed-cannot-allocate-memory/10844/1 "2019-07-25T20:38:47Z")

</div>

Hopefully someone can help me figure this out. I have gotten this error over and over, have followed the below steps to prevent it (from 2 links) and am not sure what I am doing wrong. Any help is more than appreciated!

> [@An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more](https://forum.qiime2.org/t/an-error-was-encountered-while-running-dada2-in-r-return-code-1-please-inspect-stdout-and-stderr-to-learn-more/1938/25):
>
> Thanks @wangj50! I agree! I updated that to clarify, "is likely not the case for your demultiplexed data". With that said, looking back at that log, I made a mistake and must've misread something - I thought that there were the same number of unique sequences in each sample, fwd and reverse (that would likely be an issue, because then everything truly would be identical between fwd and rev). Given that, probably none of what I wrote above is valid, realizing I made a mistake! Thanks! That i…

(qiime2-2019.1) qiime2@qiime2core2019-1:~/18S$  
qiime dada2 denoise-single  
--i-demultiplexed-seqs trimmed-remove-primers.qza  
--p-trim-left 0  
--p-trunc-len 254  
--o-representative-sequences rep-seqs-dada2.qza  
--o-table table-dada2.qza  
--o-denoising-stats stats-dada2.qza  
--verbose

Running external command line application(s). This may print messages to stdout and/or stderr.  
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run\_dada\_single.R /tmp/q2-SingleLanePerSampleSingleEndFastqDirFmt-zq0hs0zs /tmp/tmpj2pueyp1/output.tsv.biom /tmp/tmpj2pueyp1/track.tsv /tmp/tmpj2pueyp1 27 0 2.0 2 Inf consensus 1.0 1 1000000 NULL 16

R version 3.4.1 (2017-06-30)  
Loading required package: Rcpp  
DADA2 R package version: 1.6.0

1. Filtering Error: cannot allocate vector of size 95.4 Mb  
Execution halted  
Warning message:  
system call failed: Cannot allocate memory  
Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 152, in \_denoise\_single  
run\_commands([cmd])  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 36, in run\_commands  
subprocess.run(cmd, check=True)  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/subprocess.py", line 418, in run  
output=stdout, stderr=stderr)  
subprocess.CalledProcessError: Command '['run\_dada\_single.R', '/tmp/q2-SingleLanePerSampleSingleEndFastqDirFmt-zq0hs0zs', '/tmp/tmpj2pueyp1/output.tsv.biom', '/tmp/tmpj2pueyp1/track.tsv', '/tmp/tmpj2pueyp1', '27', '0', '2.0', '2', 'Inf', 'consensus', '1.0', '1', '1000000', 'NULL', '16']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2cli/commands.py", line 274, in **call**  
results = action(\*\*arguments)  
File "\</home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/decorator.py:decorator-gen-440\>", line 2, in denoise\_single  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/qiime2/sdk/action.py", line 231, in bound\_callable  
output\_types, provenance)  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/qiime2/sdk/action.py", line 365, in _callable\_executor_  
output\_views = self.\_callable(\*\*view\_args)  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 187, in denoise\_single  
band\_size='16')  
File "/home/qiime2/miniconda/envs/qiime2-2019.1/lib/python3.6/site-packages/q2\_dada2/\_denoise.py", line 163, in \_denoise\_single  
" and stderr to learn more." % e.returncode)  
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

Plugin error from dada2:

An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

See above for debug info.

---

<div class="post-metadata">

### Author: ![ebriese](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebriese/32/5354_2.png) [@ebriese](https://forum.qiime2.org/u/ebriese)
#### Post date: [July 25, 2019, 11:39pm UTC](https://forum.qiime2.org/t/dada2-system-call-failed-cannot-allocate-memory/10844/2 "2019-07-25T23:39:04Z")

</div>

I would like to add that whenever i solve Error Code 1, i continually get error code -9. These alternate repeatedly.

---

<div class="post-metadata">

### Author: ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)
#### Post date: [July 26, 2019, 11:39am UTC](https://forum.qiime2.org/t/dada2-system-call-failed-cannot-allocate-memory/10844/3 "2019-07-26T11:39:56Z")

</div>

Welcome to the forum, @ebriese!

> [@ebriese](#):
>
> I would like to add that whenever i solve Error Code 1, i continually get error code -9. These alternate repeatedly.

You are getting two variants of the same problem: memory errors. Error Code 1 is annoying because you need to read through the log to figure out what went wrong (e.g., the error code 1 forum topic that you linked to is for a different problem if you read the "fine print"), but error code -9 is quite unambiguously a memory error, and there are lots of forum topics discussing this.

Here is the key line in your error code 1:

> [@ebriese](#):
>
> system call failed: Cannot allocate memory

I suggest checking out the forum archive to see how others managed that error; unfortunately, for dada2 the solution almost always is that you need to get access to a more powerful computer:  
[https://forum.qiime2.org/search?q=system%20call%20failed%3A%20Cannot%20allocate%20memory](https://forum.qiime2.org/search?q=system%20call%20failed%3A%20Cannot%20allocate%20memory)

How much RAM do you have on your computer? Do you have access to an institutional cluster or another computer in your lab that can handle this dataset?
