PDA

View Full Version : OutOfMemoryError wordpress 2.8.1


yvesG
08-07-2009, 03:05 AM
Hi

I am testing wordpress 2.8.1 with quercus 3.2.1 deployed under glassfish 2.1 ubuntu 9.04.
When i start the web application, after a while i get a OutOfMemoryError with the following log:
java.lang.OutOfMemoryError: Java heap space
at com.caucho.quercus.env.StringBuilderValue.<init>(StringBuilderValue.java:66)
at com.caucho.quercus.env.LargeStringBuilderValue.sub Sequence(LargeStringBuilderValue.java:356)
at com.caucho.quercus.env.StringValue.substring(Strin gValue.java:1618)
at com.caucho.quercus.lib.string.StringModule.explode (StringModule.java:593)
at sun.reflect.GeneratedMethodAccessor179.invoke(Unkn own Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.caucho.quercus.module.StaticFunction.invoke(St aticFunction.java:129)
at com.caucho.quercus.env.JavaInvoker.callMethod(Java Invoker.java:604)
at com.caucho.quercus.env.JavaInvoker.call(JavaInvoke r.java:539)
at com.caucho.quercus.env.AbstractJavaMethod.callCopy (AbstractJavaMethod.java:91)
at com.caucho.quercus.expr.FunctionExpr.evalImpl(Func tionExpr.java:180)
at com.caucho.quercus.expr.FunctionExpr.evalCopy(Func tionExpr.java:150)
at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr .java:86)
at com.caucho.quercus.program.ExprStatement.execute(E xprStatement.java:64)
at com.caucho.quercus.program.BlockStatement.execute( BlockStatement.java:105)
at com.caucho.quercus.program.Function.callImpl(Funct ion.java:352)
at com.caucho.quercus.program.Function.call(Function. java:292)
at com.caucho.quercus.program.AbstractFunction.callMe thod(AbstractFunction.java:309)
at com.caucho.quercus.env.ObjectExtValue.callMethod(O bjectExtValue.java:602)
at com.caucho.quercus.expr.MethodCallExpr.eval(Method CallExpr.java:104)
at com.caucho.quercus.expr.Expr.evalArg(Expr.java:411 )
at com.caucho.quercus.expr.MethodCallExpr.eval(Method CallExpr.java:97)
at com.caucho.quercus.program.ExprStatement.execute(E xprStatement.java:64)
at com.caucho.quercus.program.IfStatement.execute(IfS tatement.java:84)
at com.caucho.quercus.program.BlockStatement.execute( BlockStatement.java:105)
at com.caucho.quercus.program.ForStatement.execute(Fo rStatement.java:76)
at com.caucho.quercus.program.BlockStatement.execute( BlockStatement.java:105)
at com.caucho.quercus.program.Function.callImpl(Funct ion.java:352)
at com.caucho.quercus.program.Function.call(Function. java:292)
at com.caucho.quercus.program.AbstractFunction.callMe thod(AbstractFunction.java:309)
at com.caucho.quercus.env.ObjectExtValue.callMethod(O bjectExtValue.java:602)
at MO.import_from_reader(/home/yves/Logiciels/geonetwork2.4final/web/wordpress/wp-includes/pomo/mo.php:138)


The (possibly) guilty php code in mo.php is:


function get_byteorder($magic) {

// The magic is 0x950412de

// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
$magic_little = (int) - 1794895138;
$magic_little_64 = (int) 2500072158;
// 0xde120495
$magic_big = ((int) - 569244523) && 0xFFFFFFFF;

if ($magic_little == $magic || $magic_little_64 == $magic) {
return 'little';
} else if ($magic_big == $magic) {
return 'big';
} else {
return false;
}
}

function import_from_reader($reader) {
$reader->setEndian('little');
$endian = MO::get_byteorder($reader->readint32());
if (false === $endian) {
return false;
}
$reader->setEndian($endian);

$revision = $reader->readint32();
$total = $reader->readint32();
// get addresses of array of lenghts and offsets for original string and translations
$originals_lenghts_addr = $reader->readint32();
$translations_lenghts_addr = $reader->readint32();

$reader->seekto($originals_lenghts_addr);
$originals_lenghts = $reader->readint32array($total * 2); // each of
$reader->seekto($translations_lenghts_addr);
$translations_lenghts = $reader->readint32array($total * 2);

$length = create_function('$i', 'return $i * 2 + 1;');
$offset = create_function('$i', 'return $i * 2 + 2;');

for ($i = 0; $i < $total; ++$i) {
$reader->seekto($originals_lenghts[$offset($i)]);
$original = $reader->read($originals_lenghts[$length($i)]);
$reader->seekto($translations_lenghts[$offset($i)]);
$translation = $reader->read($translations_lenghts[$length($i)]);
if ('' == $original) {
$this->set_headers($this->make_headers($translation));
} else {
$this->add_entry($this->make_entry($original, $translation));
}
}
return true;
}


Has anyone else got the same problem and has any idea ?
Thanks
Yves

ferg
08-07-2009, 09:29 PM
We need to link the 4.0.1 quercus release. This should already be fixed.

yvesG
08-10-2009, 07:20 AM
Looking forward to testing with version 4.0.1 then
Thank you
Yves.