From: Michael Wall <mwall@liquidmarket.com>
To: caml-list@inria.fr
Subject: memory problems
Date: Thu, 22 Jun 2000 13:19:13 -0700 [thread overview]
Message-ID: <395274C1.B37DCF95@liquidmarket.com> (raw)
hi everyone,
i have an interesting problem i've run into a few times regarding memory
leaks and reference passing.
basically, if i pass a reference to a recursive binding i get a memory
leak when
i compile with the optimized compiler but if i compile with the bytecode
compiler
everything is ok. eg:
in main:
let maxI = ref 1000 in
let vnew = COMPLEX_HOPFIELD.relax_neat (p, v, h, t, s, n, maxI) in
in relax_neat:
let rec relax_neat (p, v, h, t, s, n, maxI) =
maxI:=!maxI -1;
let pnew = runge_katta p h t s ({real = 1e-1; imag = 0.0}) n in
let vnew = p_to_v pnew n in
let hnew = to_h t vnew s n in
let eps = COMPLEX_MATH.dis v vnew n in
if !maxI > 0 && eps > 1.e-15 then (relax_neat (pnew, vnew, hnew,
t, s, n, maxI)) else
vnew
i know its the reference be the optimized program ceases to leak when i
remove it.
forgive me if this is a known problem, i am new to caml and this group.
anyones insight into this would be greatly appreciated,
Regards,
--
Mike Wall
310-225-2975 ext 156
mwall@liquidmarket.com
next reply other threads:[~2000-06-23 14:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-22 20:19 Michael Wall [this message]
2000-06-23 14:42 ` Pierpaolo Bernardi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=395274C1.B37DCF95@liquidmarket.com \
--to=mwall@liquidmarket.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox