title: LLVM ERROR: out of memory ?? How to fix this error (if its fixable)
body: <p>Okay I am Solving <a href="https://leetcode.com/problems/longest-increasing-subsequence/" rel="nofollow noreferrer">https://leetcode.com/problems/longest-increasing-subsequence/</a>
  My code is Correct and runs fine without memonization(TLE), but after memonized it gives error :</p>
  <pre><code>LLVM ERROR: out of memory
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
  </code></pre>
  <p>My code:</p>
  <pre><code>class Solution {
  public:
      int dp[2555][25000005];
      int fun(vector&lt;int&gt;&amp; a, vector&lt;int&gt;&amp; v, int i, int count) {
          int n = a.size();
          if(i == n) return count;
          if(dp[i][count] != -1) return dp[i][count];
          
          if(v.back() &lt; a[i]) {
              v.push_back(a[i]);
              int val1 = fun(a, v, i+1, count+1);
              v.pop_back();
              int val2 = fun(a,v,i+1,count);
              return  max(val1, val2);
          }
          else
              return fun(a,v,i+1,count);
      }
      int lengthOfLIS(vector&lt;int&gt;&amp; a) {
          vector&lt;int&gt; v;
          v.push_back(INT_MIN);
          memset(dp, -1, sizeof(dp));
          return fun(a, v, 0, 0);
      }
  };
  </code></pre>