Multichart 5 beta 6 Memory Question ....

Questions about MultiCharts and user contributed studies.
Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Multichart 5 beta 6 Memory Question ....

Postby Emmanuel » 21 May 2009

HI,

As Multicharts 5 beta 6 is 32 bits, I was a able to use for my charts about 1.8 Giga of memory for my indicators .....

But I have the following question :

Why, when I close my chart, in Multichart 5 beta 6 , the memory usage stay at 1.8 Giga ? Why Multicharts don't release the memory ? :?: :?: for the next chart ?

The only solution I have is to shut down Multicharts, but I can not always shut down Multichart, Most of the time I have to leave it open for other job.

Emmanuel

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 22 May 2009

1) What kind of memory are you referring to (Virtual, Working set,...)?
2) What do you use to measure memory usage?
3) What is min concern for you? The fact that memory is not cleared or you have some errors when the memory is full?

Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Postby Emmanuel » 22 May 2009

Hi Andrew :D

1/I am refering to the memory used by Multicharts

2/I check the memory usage with the Task Manager

3/ What concern me, is the fact that the memory don't clear when I close the chart. Each time I had a new chart, it use more memory without releasing the memory for the next chart.

What concerne me, is that fact that I have to close multichart to free the memory, and restart it, (and I can not always closed it, as Multichart is doing other job in the same time)


Emmanuel

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 27 May 2009

[1] What column of Task Manager are referring to? Memory Usage or Virtual Memory Size?

[2] "I have to close multichart to free the memory..."
Why do you need to clear memory? Do you have errors?
Windows is designed the way that it will not clear memory instantly because it is likely the memory will be used again. The cleared memory just marked that it is free and the next time the process can use it without asking OS about it. If you close a chart Task Manager may not show that the memory is cleared. If you want to trace memory leaks you should see MC error messages when you can't create a new chart.

janus
Posts: 838
Joined: 25 May 2009
Has thanked: 64 times
Been thanked: 105 times

Postby janus » 01 Jun 2009

I have the same issue with version 4. I draw a lot of trend lines and text. Eventually, the memory used by MC fills up all the available physical memory, and the only way to release the memory is to exit MC and start again. Removing the study does not help. This of course only happens when I draw several hundreds of lines and text, which I need to for my own back testing purposes. So, effectively MC has a sort of memory leak. It's not apparent in most situations when the amount of text and lines draw are down to more typical numbers but I suspect the same thing would happen eventually after re-running studies over and over again. BTW, I have 2 GB of physical RAM.

Also, if I use say 1 month of 1 minute data for trade, ask and bid, I eventually have my study abort with the following message:

Message: Error in study "xxx" : STD exception " not enough memory.

At the moment I simply cut down the amount of data. Is there a way to increase whatever the limit is to avoid the memory error? Will upgrading to 5.0 help?

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 03 Jun 2009

It is not a fact there is a memory leak. As I explained above the OS system has its own rules who it works with win32 applications.
If you provide me your study that fills up the memory I can try to give you more specific answer. I don't think MC 5 will help you, but you should try.

janus
Posts: 838
Joined: 25 May 2009
Has thanked: 64 times
Been thanked: 105 times

Postby janus » 03 Jun 2009

Here's a simple study to replicate the problem. Each time I insert the study on say a DOW mini futures chart going back 1 month at 1 minute resolution, I can see the memory utilization increase, as expected. When I remove the study, the memory utilization doesn't drop. If I keep doing this, eventually I would run out of physical memory. The only way to release this allocated memory is to exit MC.

variables:
intrabarpersist nb(0), id(0);

if currentbar <> nb then begin
nb = currentbar;
id = text_new_self_s(date, time_s, high, "u");
end;


Return to “MultiCharts”