in reply to Re^24: Strange memory leak using just threads (forks.pm)
in thread Strange memory leak using just threads

By "This", I assume you mean this: (...)
No. Of course, I fixed the obvious issues first - in particular the precedence issue in my $data = 'x' x 500 * 1024**2;. Also, my perl doesn't have a waitall, so I wrote wait for 1..100. For the other irrelevant warnings (caused by 'x' |= 1) I just disabled warnings... because fixing this properly with |= chr(1) doesn't cause any significant runtime difference (still takes ~5 secs). Just for the record.

Replies are listed 'Best First'.
Re^26: Strange memory leak using just threads (forks.pm)
by BrowserUk (Patriarch) on Sep 24, 2010 at 00:34 UTC
    because fixing this properly with |= chr(1) doesn't cause any significant runtime difference

    Hm. Seems strange. Without the fix, there should be no changes made to the COW memory. With it, should cause 125 * 4096 pages * 100 forks to be replicated.

    It's not a huge amount, but I'd expect to see some difference unless there is some other reason for it not to happen.

    Guess I'll just have to reinstall my *nix VM.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      ...there should be no changes made to the COW memory
      Why not? Both versions modify the string - just differently:

      $ perl -le '$data = "xxx"; substr($data, 1, 1) |= 1; print $data' x1x $ perl -le '$data = "xxx"; substr($data, 1, 1) |= chr(1); print $data' xyx