[HipHop] Porting wikidiff2 to hhvm

Max Semenik maxsem.wiki at gmail.com
Fri Mar 7 23:22:20 UTC 2014


On 08.03.2014, 1:37 Drew wrote:

> Max,

> Can you point me to the code sample where you a String is growing
> indefinitely? Is it PHP code, or is it extension code? What specific API
> is being used to grow the string?

> Obviously we want to protect programmers from shooting themselves in the
> foot, but at the same time we don't want to have unreasonably low limits
> that prevent programmers from working with large strings. Having more
> context would help with figuring out what the right course of action is.

PHP:
str_repeat( 1000000000000000, 'x' );

C++:
std::string x("x", 10000000);
HPHP::String s;
while(1) s += x;

We at Wikipedia sometimes encounter some situations where some
operations hit PHP's memory_limit which is currently at 200M -
usually due to parsing some large pages where users push wikitext to
extreme:) Wonder how things would look without sandboxing - will it be
easier to send servers to swapdeath?

Anyway, my question was whether my extension code should stick to
stock C/STL memory management or there is something HHVM-specific.

-- 
Best regards,
  Max Semenik ([[User:MaxSem]])




More information about the HipHop mailing list