Ah, this could explain it. memory() uses a Windows function, GetProcessMemoryInfo(). This function is rarely used in applications and I can imagine that it is not properly supported by Wine. Can you test the same script on a real Windows system?