title: Linux memory allocation on Rstudio/Rstudio Server
body: <p>I am trying to do clustering with CLARA using Rstudio on Linux and I have a very large dataset.</p>
  <p>However, it seemed that the memory is not enough for the whole dataset?</p>
  <pre><code>## Estimating the number of clusters ----
  fviz_nbclust(df, clara, method = &quot;silhouette&quot;, k.max = 15)
  </code></pre>
  <p>It showed me this:</p>
  <p>Error: cannot allocate vector of size 339.8 GB</p>
  <p>So I tried all of this and it still didn't work. memory.limit is also specific for Windows only (I still gave it a try tho).</p>
  <pre><code># devtools::install_github(&quot;krlmlr/ulimit&quot;)
  # gc() 
  # memory.limit(9999999999)
  # 
  # 
  # install.packages(&quot;devtools&quot;, dependencies = TRUE)
  # devtools::install_github(&quot;krlmlr/ulimit&quot;)
  # ulimit::memory_limit(2000)
  # 
  # devtools::install_github(&quot;jeroen/unix&quot;)
  # 
  # 
  # if(.Platform$OS.type == &quot;windows&quot;) withAutoprint({
  #   memory.size()
  #   memory.size(TRUE)
  #   memory.limit()
  # })
  # memory.limit(size=56000)
  # memory.size(max = FALSE)
  </code></pre>
  <p>Can somebody help me with this?</p>
  <p>Any help would be appreciated!</p>