Memory leak?

N

Nathan Smith

Hello,

I get very different results in my program when I add a simple print
statement that makes no changes to the running code. Unfortunately
the algorithm is too involved to post.

Are there any known memory leaks in Ruby 1.8.2? Thanks

Nate
 
R

Robert Klemme

Nathan said:
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? How big were the differences?

You probably created some temporary strings for / during printing and the
GC doesn't collect them immediately.
statement that makes no changes to the running code. Unfortunately
the algorithm is too involved to post.

Are there any known memory leaks in Ruby 1.8.2? Thanks

Dunno.

Kind regards

robert
 
N

Nathan Smith

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..... :(

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
 
N

Nathan Smith

What kind of results? Memory usage? Was this the first output
statement
in the whole program? How big were the differences?

You probably created some temporary strings for / during printing
and the
GC doesn't collect them immediately.

I'm also going to try out 1.8.3 to see if that resolves anything
 
R

Robert Klemme

Nathan said:
I have many print statements, although I'll cut them out to see if
anything changes.


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.....
:(

Wait, you say the type of objects changes and call that a memory leak?
This doesn't make sense to me - at least not in the light of the
information you have disclosed so far.
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

Difficult with GC. You could use ObjectSpace to create some statistics
for objects per class or such.

robert
 
E

ES

Le 8/6/2005 said:
I have many print statements, although I'll cut them out to see if
anything changes.


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,937
Members
47,481
Latest member
ElviraDoug

Latest Threads

Top