Thanks, Stefan. My code is all in Julia. That is why I was surprised that 
memory didn't get freed until I explicitly called gc().

On Thursday, April 2, 2015 at 5:02:27 PM UTC+2, Stefan Karpinski wrote:
>
> I'm afraid this is a little too vague to help debugging. If you are 
> calling C code that allocates memory and doesn't free it, then there's 
> nothing that Julia's GC can do about it. If normal Julia code allocates 
> memory, it will get freed once there's no way to reach it anymore.
>
> On Thu, Apr 2, 2015 at 7:51 AM, Ali Rezaee <[email protected] 
> <javascript:>> wrote:
>
>> Dear all,
>>
>> I have faced a situation that was unexpected to me. Would you let me know 
>> if this was expected or this is a bug?
>>
>> I have a very long code, so I could not put an example here. But the 
>> situation is that I have a function in a separate file that I have included 
>> in my code. 
>> Some where in my code, I call the function for thousands of times, and 
>> each time it returns an integer, 0 or 1. The problem is that with each call 
>> of the function, memory usage of my pc increases by one percent and is not 
>> deallocated after the function is finished.
>> I could circumvent the problem by explicitly using the garbage collector 
>> gc(). 
>> Should Julia not have collected garbage automatically after a function 
>> from an external library has finished running?
>>
>> Many thanks
>>
>
>

Reply via email to