PenCollector: not enough space in array

 

Jounal:

2007.07.01 23:38:06 PenCollector: not enough space in array

I have this error...

What is it?

 
Your resources (GDI and/or operating memory) are exhausted
 
stringo:
Your resources (GDI and/or operating memory) are exhausted


Thank you.

 
phy:
stringo:
Your resources (GDI and/or operating memory) are exhausted


Thank you.


As it turns out, I was calculating a color by directly setting the red/green/blue values.

I suppose, that "after a while", the System ran out of space to remember all the colors I had created, although

I have no need for them to be remembered.

 
Do You calculate a color in some EA (script, CI)?
 
stringo:
Do You calculate a color in some EA (script, CI)?


Yes, I calculated the color of some objects in a Script/EA. Many different values were

calculated during runtime.

Now I create a fixed reference array of RGB values for ObjectSet(name, objprop_color, myRBG[x]) ,

and have no more PenCollector problem.

To reproduce error, try this script:

int start()
  {
 
    string name = "ColorTestRectangle";
    int  R, G, B;
    
    ObjectCreate(name, OBJ_RECTANGLE, 0, Time[0], Close[0]+100*Point, Time[100], Close[0]-100*Point);
    
    while(!IsStopped()){
        for(R = 0; R < 256; R++){
            for(B = 256; B < 256*256; B += 256){
                for(G = 65536; G < 256*65536; G += 65536){
                    ObjectSet(name, OBJPROP_COLOR, R+G+B);
                }
            }
        }
        WindowRedraw();
        Sleep(5);
    }
   return(0);
}
 
//    After a while, check journal:
//    2007.07.08 13:09:21    PenCollector: not enough space in array

Today (market closed) there are no ticks coming, I have to click on the chart to see rectangle color change.

 

1. Error is not reproduced

2. Chart redrawn when ticks income or when WindowRedraw function called (your Window redraw called after 16777216 cycles)

 
stringo:

1. Error is not reproduced

2. Chart redrawn when ticks income or when WindowRedraw function called (your Window redraw called after 16777216 cycles)

 

Ok, will look again next weekend...

Reason: