Page 1 of 1

Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: April 9th, 2014, 4:34 pm
by johnc
Running a wordpress request on Phalanger 4.0 is throwing an OOM Exception performing some regex.

I've dumped the stack trace here: http://privatepaste.com/9edf63a2a7

The code in question:

Code: Select all
function remove_accents($string) {
   if ( !preg_match('/[\x80-\xff]/', $string) )
      return $string;


The preg_match is what causes the exception.

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: April 9th, 2014, 4:44 pm
by johnc
I disabled the preg to watch the request some more and it hits another OOM Exception on a preg_replace.

Thinking the regex code in Phalanger is a bit memory hungry?

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: April 9th, 2014, 10:08 pm
by Jakub Misek
Sadly .NET regular expressions are very slow and memory consuming ... We are planning to use some 3rd party component instead.

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: April 10th, 2014, 11:21 pm
by johnc
I wonder what's different now. I remember being able to run Wordpress on Phalanger 3.0 :/

How incredibly frustrating, now that I have the tools to work on my project I can't work on my project.

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: April 15th, 2014, 10:25 pm
by Jakub Misek
There were no changes in this area. Maybe the regular expression is different?

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: May 6th, 2014, 6:26 am
by johnc
The regex looks fine to me, though WP uses them in a few places.

AFAIK this should be working, it's very disappointing that phalanger can't seem to run a single wordpress request from Visual Studio.

We're also getting System.FormatException's when wordpress tries to run it's cron:

[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +10689507
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +145
System.Int32.Parse(String s) +23
PHP.Library.StreamSocket.SplitSocketAddressPort(String& socket, Int32& port) +200

So far I'm very disappointed by my purchase.

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: May 9th, 2014, 11:15 am
by Jakub Misek
Please note, Phalanger is free opensource project; we are helping by fixing bugs reported at phalanger.codeplex.com or github.com/DEVSENSE/Phalanger

We'll take a look at the OOM exception.

Thanks,

Re: Phalanger 4.0: OutOfMemoryException running wordpress

PostPosted: May 9th, 2014, 3:29 pm
by johnc
I wonder if the OOM is actually a simple error and the error reporting is causing an OOM condition.