|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35284 gmp_mod() has memory leak since very long time
Submitted: 2005-11-18 21:08 UTC Modified: 2005-11-18 21:29 UTC
From: hoarau76 at free dot fr Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 5.0.5 OS: freebsd 6 x86
Private report: No CVE-ID: None
 [2005-11-18 21:08 UTC] hoarau76 at free dot fr
there is a very long bug with gmp_mod(): memory leak problem
which was reported here in may 2004 here:
and it persists

Reproduce code:
for ($i=10000000;$i > 0;$i--) { $x = gmp_mod($i,"64");}

Expected result:
when you do a "top" you see the memory usage increasing very quickly

Actual result:
FATAL:  emalloc():  Unable to allocate 309 bytes


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-18 21:29 UTC]
We have only one bug system where you can report a bug and it is

And yes, gmp_mod() (not the function itself, but the underlying gmp routines) use memory quite aggressively.
Report that to GMP authors.
Not PHP problem.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC