# "make verilog" throws java memory error

**URL:** <https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328>\
**Category:** Freedom E300\
**Created:** [February 8, 2017, 9:48pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328 "2017-02-08T21:48:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![db1](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@db1](https://forums.sifive.com/u/db1)\
**Post date:** [February 8, 2017, 9:48pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/1 "2017-02-08T21:48:45Z")

</div>

Hi all, I just pulled the freedom github repo and ran “make -f Makefile.e300artydevkit verilog”. It chugs along for a bit and now won’t progress past a java memory error:

```
[info] 'compiler-interface' not yet compiled for Scala 2.11.7. Compiling...
sbt appears to be exiting abnormally.
  The log file for this session is at /tmp/sbt8497818078338583763.log
java.lang.OutOfMemoryError: PermGen space
Error during sbt execution: java.lang.OutOfMemoryError: PermGen space

```

I don’t think my system is actually out of memory; top shows about 2.5GB free right now. Is there a specific version of java I need to run this makefile?

---

<div class="post-metadata">

**Author:** ![rxia](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rxia](https://forums.sifive.com/u/rxia)\
**Post date:** [February 8, 2017, 9:56pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/2 "2017-02-08T21:56:57Z")

</div>

I’m not an expert at the JVM, but you could attempt to increase the amount of Perm space allocated. Try increasing the value of `MaxPermSize` in this line of the Makefile: [https://github.com/sifive/freedom/blob/f4375c22662f82b1b4f94e88b1aba6998b1f34ba/common.mk#L23](https://github.com/sifive/freedom/blob/f4375c22662f82b1b4f94e88b1aba6998b1f34ba/common.mk#L23)

---

<div class="post-metadata">

**Author:** ![rxia](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rxia](https://forums.sifive.com/u/rxia)\
**Post date:** [February 8, 2017, 10:00pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/3 "2017-02-08T22:00:28Z")

</div>

Actually, I read your error message more carefully and now see that this is happening when you run sbt, so modify [this line](https://github.com/sifive/freedom/blob/f4375c22662f82b1b4f94e88b1aba6998b1f34ba/common.mk#L19) of the Makefile to add in the same memory-related flags from the FIRRTL command:

```auto
-Xmx2G -Xss8M -XX:MaxPermSize=256M 

```

---

<div class="post-metadata">

**Author:** ![db1](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@db1](https://forums.sifive.com/u/db1)\
**Post date:** [February 8, 2017, 10:53pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/4 "2017-02-08T22:53:30Z")

</div>

OK, that gets me past the first error! Now I’ve got more java hiccups. Java is really not my forte so I don’t even know where to start to fix these, but am I missing some files?

```
[info] Compiling 55 Scala sources and 4 Java sources to /home/aa/grad/db/freedom/rocket-chip/firrtl/target/scala-2.11/classes...
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/Emitter.scala:31: object file is not a member of package java.nio
[error] import java.nio.file.{Paths, Files}
[error] ^
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/StringLit.scala:32: object StandardCharsets is not a member of package java.nio.charset
[error] import java.nio.charset.StandardCharsets.UTF_8
[error] ^
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/StringLit.scala:50: not found: value UTF_8
[error] if (c >= 0x20 && c <= 0x7e) new String(Array(c), UTF_8)
[error] ^
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/StringLit.scala:94: object StandardCharsets is not a member of package java.nio.charset
[error] val byteArray = raw.getBytes(java.nio.charset.StandardCharsets.UTF_8)
[error] ^
[error] four errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 26 s, completed Feb 8, 2017 2:49:47 PM
```

---

<div class="post-metadata">

**Author:** ![rxia](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rxia](https://forums.sifive.com/u/rxia)\
**Post date:** [February 8, 2017, 10:56pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/5 "2017-02-08T22:56:11Z")

</div>

What version of Java are you running? I believe `java.nio.file` was introduced in Java 7.

---

<div class="post-metadata">

**Author:** ![db1](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@db1](https://forums.sifive.com/u/db1)\
**Post date:** [February 9, 2017, 12:46am UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/6 "2017-02-09T00:46:29Z")

</div>

That was the problem – my path was pointed to java 1.6. Switched to 1.8 and everything works now. Thanks!

---

<div class="post-metadata">

**Author:** ![pengnainqi](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/pengnainqi/32/262_2.png) [@pengnainqi](https://forums.sifive.com/u/pengnainqi)\
**Post date:** [June 28, 2017, 3:39am UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/7 "2017-06-28T03:39:45Z")

</div>

Thanks Richard,

I have tried your advice, but failed ! can you tell another?

---

<div class="post-metadata">

**Author:** ![pengnainqi](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/pengnainqi/32/262_2.png) [@pengnainqi](https://forums.sifive.com/u/pengnainqi)\
**Post date:** [June 28, 2017, 3:45am UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/8 "2017-06-28T03:45:55Z")

</div>

Thank you,

I met that trouble also,if you solved it, please tell me ! Thanks very much~

---

<div class="post-metadata">

**Author:** ![rxia](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rxia](https://forums.sifive.com/u/rxia)\
**Post date:** [June 28, 2017, 5:22pm UTC](https://forums.sifive.com/t/make-verilog-throws-java-memory-error/328/9 "2017-06-28T17:22:19Z")

</div>

Hi Pengnainqi, I assume you also posted this question in GitHub shortly afterwards: [https://github.com/sifive/freedom/issues/28](https://github.com/sifive/freedom/issues/28)

Let me know if my response doesn’t solve your problem.
