[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: AB memory use



PureBytes Links

Trading Reference Links

Hi Terry, Hi Tomasz;

I am not an expert c++ programmer (in fact I have never before 
programmed in a language that requires memory housekeeping), and it 
is almost certainly the case that my plugins are causing the problem, 
somehow.  However, I have put extensive _TRACE commands in my AFL, 
and I find that the error does not occur when my plugin is called.  
It occurs during the execution of other AFL functions, although I 
cannot find a consistent pattern to when the error occurs.

I REALLY appreciate the offer to send in my code -- that is SO 
gracious -- and will do that in a case of last resort!

Meanwhile, two questions:

1. Is there a way to see the current available memory in real time, 
or to have the _Trace command write it, from within AFL?  This would 
I think help me see what is causing the problem.  Also, how much 
total available memory is there to begin with?  Sorry for being 
stupid, but I just don't know.

2. What do I need to do regarding memory allocation in my plugins?  
My plugin basically creates a set of AB string variables using 
gSite.setvariable(),and it does this often.  Can I assume that AB is 
taking care of freeing this memory, or should I be calling gSite.free
() somewhere? I found this information on the board:


"You have to call gSite.Free for every array allocated in your code 
via gSite.Alloc or gSite.GetArrayResult, and also for each and every 
result returned by any built-in function called by CallFunction and 
returned in AmiVar. The only exception is ONE array that you allocate 
for the result and return in AmiVar variable as a result. 

If you do not do this, the memory will be fred when formula finishes 
its execution."

However, in my case I am not returning ONE array, but many string 
variables.  This seems a likely source of my problem, but I'm not 
sure how to deal with it.  Have I missed documentation on this issue?

Thanks for your time, I really appreciate it.

Chuck






--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxx> 
wrote:
>
> Hello,
> 
> Suggestion:
> 
> 1. remove your plugins and see if you still have problems,
> if you don't - it means that the leak is inside your plugin(s).
> 
> 2. if you still have problems - send the formulas, symbol lists and 
other stuff
> required to reproduce problem to us.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
>   ----- Original Message ----- 
>   From: cstrader232 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, April 14, 2006 4:17 AM
>   Subject: [amibroker] AB memory use
> 
> 
>   Could someone help me understand ABs RAM usage?  I frequently get 
>   an "out of memory" error, which brings this otherwise great 
program to 
>   a crashing halt. I do have my own plugins and perhaps they are 
causing 
>   the problem -- although I cannot for the life of me find out 
why.  
>   Specifically, what might cause such an error?  I have 1G of RAM 
and a 
>   couple of 1m charts open.  Does the size of the plugin use up 
memory?  
>   Number of staticvars?  How about number of bars?  Number of 
functions?  
>   Number of loops?  I don't know much about CPU architecture, so 
any help 
>   is appreciated...
> 
>   thanks in advance.
> 
>   chuck
> 
> 
> 
> 
> 
> 
> 
> 
> 
>   Please note that this group is for discussion between users only.
> 
>   To get support from AmiBroker please send an e-mail directly to 
>   SUPPORT {at} amibroker.com
> 
>   For other support material please check also:
>   http://www.amibroker.com/support.html
> 
> 
> 
> 
> 
>   SPONSORED LINKS Investment management software  Real estate 
investment software  Investment property software  
>         Software support  Real estate investment analysis software  
Investment software  
> 
> 
> --------------------------------------------------------------------
----------
>   YAHOO! GROUPS LINKS 
> 
>     a..  Visit your group "amibroker" on the web.
>       
>     b..  To unsubscribe from this group, send an email to:
>      amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       
>     c..  Your use of Yahoo! Groups is subject to the Yahoo! Terms 
of Service. 
> 
> 
> --------------------------------------------------------------------
----------
>






Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/