|
|
|
|
|
Re: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space [message #523089 is a reply to message #523071] |
Thu, 25 March 2010 01:22 |
Jon Rowlands Messages: 6 Registered: July 2009 |
Junior Member |
|
|
For what it's worth, I tried to reproduce this but no luck so far. I created a package that generated 500 source files and used them to build ten libraries. This thread doesn't allow attachments, but I appended my package.bld below.
This is a stretch, but worth asking. Are you doing anything complex in your package.bld that could itself eat up heap space?
For example in my test I used java.io calls to synthesize the source files. I could imagine that maybe not closing these IO streams, or saving them in an array so that they couldn't be garbage collected, or something like that, could produce this behavior.
In any case, we'll continue to try to reproduce it.
Jon
/* compile for the first target configured in config.bld */
var target = Build.targets[0];
var letters = ['a','b','c','d','e','f','g','h','i','j'];
var digits = ['0','1','2','3','4','5','6','7','8','9'];
var quals = ['A','B','C','D','E'];
/* generate 500 dummy source files */
var sourcefiles = [];
for each (var letter in letters) {
for each (var digit in digits) {
for each (var qual in quals) {
/* generate the source file name */
var base = letter + digit + qual;
var filename = base + '.c';
sourcefiles.push(filename);
/* mark the file as generated so that it gets cleaned */
Pkg.generatedFiles.$add(filename);
/* generate the contents */
if (!java.io.File(filename).exists()) {
var ps = java.io.PrintStream(filename);
ps.println("int " + base + " = 1;");
ps.close();
}
}
}
}
/* generate ten libraries */
var libs = [];
for each (var letter in letters) {
/* register the library */
var libName = letter;
var lib = Pkg.addLibrary(libName, target);
/* add all the source files to the library */
for each (var filename in sourcefiles) {
lib.addObjects([filename]);
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04748 seconds