Le 8/6/2005, "Nathan Smith" <nsmith5 / nist.gov> a ?crit:
>
>On Jun 8, 2005, at 10:20 AM, Robert Klemme wrote:
>
>> Nathan Smith wrote:
>>
>>> Hello,
>>>
>>> I get very different results in my program when I add a simple print
>>>
>>
>> What kind of results?  Memory usage?  Was this the first output
>> statement
>> in the whole program?
>
>I have many print statements, although I'll cut them out to see if
>anything changes.
>
>> You probably created some temporary strings for / during printing
>> and the
>> GC doesn't collect them immediately.
>
>Aye, I thought of that, but the problem is a little deeper than that.
>Objects are being created dynamically, and the actual type of the
>object that is created changes -- depending on if I put enough print
>statements into the code. It looks and smells like a memory leak..... :(

It really does not seem like a memory leak (although I suppose it
could be one). Perhaps you are thinking of a memory access error
or something like going over an array index in C?

It is really impossible to say what may be going wrong, except for
"remember that everything in Ruby is an expression". Please post
your algo (or a reduced version as long as the error remains) if
you at all can.

>Are there any tools that can verify this? Seems like that would be a
>problem, considering that Ruby generally doesn't have memory leaks.
>Thanks for your help
>
>Nate

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }