You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 110 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi,
Thank you for your message to the Caml mailing list.
However your message seems to be a bug report; hence I send it to the
relevant mailing list
I have a memory leak which I believe arises from some problem in the
compiler. I've confirmed the leak for ocaml-2.04 and ocaml-3.00. The
problem is centered around the flag 'stupid' in the following code.
If 'stupid = true' there is a serious memory leak. If 'stupid = false'
there is no memory leak. This is the only place in the code this flag
is used and all subfunctions are side-effect free.
let detection oneway stupid get_start_belief clean sigma or_sigma distance
orientation seer_id seen_id seer_beliefs seen_beliefs =
let dims_1 = Array.init 2 (fun x -> x) in
let dims_2 = Array.init 3 (fun x -> x) in
let rec dring_1 = Sample.x::Sample.y::dring_1 in
let rec dring_2 = Sample.x::Sample.y::Sample.theta::dring_2 in
let seer_sample_for_seen, seer_beliefs =
if stupid then Belief_states.Map.find seer_id seer_beliefs, seer_beliefs
else Belief_states.get get_start_belief seen_id seer_id seer_beliefs in
let seen_according_to_seer =
clean (Array.map (to_observed distance sigma orientation or_sigma) seer_sample_for_seen) in
let seen_belief = Belief_states.Map.find seen_id seen_beliefs in
let new_seen_belief =
integrator oneway dims_1 dims_2 0.01 dring_1 dring_2 seen_according_to_seer seen_belief in
let new_seen_beliefs = Belief_states.Map.add seen_id new_seen_belief seen_beliefs in
let new_seer_beliefs =
if not oneway or true then
let seen_sample_for_seer, seen_beliefs =
if stupid then Belief_states.Map.find seen_id seen_beliefs, seen_beliefs
else Belief_states.get get_start_belief seer_id seen_id seen_beliefs in
let seer_according_to_seen =
clean (Array.map (to_observer distance sigma) seen_sample_for_seer) in
let seer_belief = Belief_states.Map.find seer_id seer_beliefs in
let new_seer_belief =
integrator oneway dims_2 dims_2 0.01 dring_2 dring_2 seer_according_to_seen seer_belief in
let new_seer_beliefs = Belief_states.Map.add seer_id new_seer_belief seer_beliefs in
new_seer_beliefs
else seer_beliefs in
new_seer_beliefs, new_seen_beliefs
Does anyone have an idea for how to debug this or what the underlying
problem is? Naturally, I can try cutting code to isolate the bug
further but that approach seems awkward as the overall program (which
is used for monte carlo multi robot localization) is not very small.
-John
The text was updated successfully, but these errors were encountered:
Original bug ID: 110
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi,
Thank you for your message to the Caml mailing list.
However your message seems to be a bug report; hence I send it to the
relevant mailing list
caml-bugs@inria.fr
Thank again for your interest in Caml.
Pierre Weis
INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/
The text was updated successfully, but these errors were encountered: