2013-05-20 3 views
7

से बाहर चलाता है मैं कुछ कोड का परीक्षण करने के लिए एसबीटी 0.12.3 का उपयोग कर रहा हूं और अक्सर ~test कमांड के साथ इंटरैक्टिव परीक्षण करते समय मुझे यह त्रुटि संदेश मिलता है।एसबीटी मेमोरी

8. Waiting for source changes... (press enter to interrupt) 
[info] Compiling 1 Scala source to C:\Users\t\scala-projects\scala test\target\s 
cala-2.10\classes... 
sbt appears to be exiting abnormally. 
    The log file for this session is at C:\Users\t\AppData\Local\Temp\sbt566325905 
3150896045.log 
java.lang.OutOfMemoryError: PermGen space 
     at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) 
     at java.util.concurrent.FutureTask.get(Unknown Source) 
     at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala: 
196) 
     at sbt.Execute.next$1(Execute.scala:85) 
     at sbt.Execute.processAll(Execute.scala:88) 
     at sbt.Execute.runKeep(Execute.scala:68) 
     at sbt.EvaluateTask$.run$1(EvaluateTask.scala:162) 
     at sbt.EvaluateTask$.runTask(EvaluateTask.scala:177) 
     at sbt.Aggregation$$anonfun$4.apply(Aggregation.scala:46) 
     at sbt.Aggregation$$anonfun$4.apply(Aggregation.scala:44) 
     at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:137) 
     at sbt.Aggregation$.runTasksWithResult(Aggregation.scala:44) 
     at sbt.Aggregation$.runTasks(Aggregation.scala:59) 
     at sbt.Aggregation$$anonfun$applyTasks$1.apply(Aggregation.scala:31) 
     at sbt.Aggregation$$anonfun$applyTasks$1.apply(Aggregation.scala:30) 
     at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.sca 
la:62) 
     at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.sca 
la:62) 
     at sbt.Command$.process(Command.scala:90) 
     at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71 
) 
     at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71 
) 
     at sbt.State$$anon$2.process(State.scala:170) 
     at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71) 
     at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71) 
     at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) 
     at sbt.MainLoop$.next(MainLoop.scala:71) 
     at sbt.MainLoop$.run(MainLoop.scala:64) 
     at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:53) 
     at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:50) 
     at sbt.Using.apply(Using.scala:25) 
     at sbt.MainLoop$.runWithNewLog(MainLoop.scala:50) 
     at sbt.MainLoop$.runAndClearLast(MainLoop.scala:33) 
     at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:17) 
Error during sbt execution: java.lang.OutOfMemoryError: PermGen space 

त्रुटि स्पष्ट है, मैं ढेर आकार में वृद्धि बादल और यह कि त्रुटि फेंक बंद कर सकता है, लेकिन बात यह संख्या के बाद बंद हो जाता है वह यह है कि परीक्षण बातचीत के साथ (मैं कितने पता नहीं है) कोड में एक न्यूनतम परिवर्तन, और यदि ढेर में एक साधारण वृद्धि समस्या को हल करेगी या मुझे अतिरिक्त काम करना है जो स्मृति से बाहर नहीं निकलता है।

अग्रिम धन्यवाद।

उत्तर

5

यदि आपने नहीं किया है, तो अपने sbt.bat में अधिक PermGen स्थान देने का प्रयास करें। मैं विंडोज़ पर एसबीटी नहीं चलाता, लेकिन मैं java -Xmx1512M -XX:MaxPermSize=512M देता हूं। कोशिश करने के लिए एक और चीज परीक्षण के दौरान कांटा हो सकता है: http://www.scala-sbt.org/release/docs/Detailed-Topics/Testing#forking-tests

संस्करण 0.12.0 में, एक अलग जेवीएम में परीक्षण चलाने की सुविधा जोड़ा गया था। की स्थापना

fork in Test := true 

निर्दिष्ट करता है कि सभी परीक्षणों के एक भी बाहरी JVM में क्रियान्वित की जाएगी।