Re: cf-agent and memory usage

"'[email protected]' via help-cfengine" <[email protected]>
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
I did find this old ticket that I think is related: 
https://tracker.mender.io/browse/CFE-1785

The reproducer there seems to be similar to what you are describing and 
testing it myself seems to be a good reproducer of what is happening for 
you and have nothing to do with size of policy and number of classes/vars 
involved. I'll bump that ticket up in priority and we'll try and get into 
it soon.

-Craig
On Tuesday, January 4, 2022 at 11:00:16 AM UTC-6 [email protected] 
wrote:

> Here are the docs for the datastate() function for reference: 
> https://docs.cfengine.com/docs/3.18/reference-functions-datastate.html
>
> I would assume that the return from datastate() is quite large due to your 
> policy defining many vars and classes.
>
> Can you give a minimal reproducer of some sort or some more information 
> about your policy that does something like
>
> ```
> "state" data => datastate();
> ```
>
> From what you said I assume you have something like that and using 
> cf-agent --verbose or --debug you can see that it is "redone in pass 2"?
>
> Could you use classesmatching to find just the classes you want and send 
> those to your template? 
> https://docs.cfengine.com/docs/3.18/reference-functions-classesmatching.html
>
> -Craig
>
> On Tuesday, January 4, 2022 at 10:32:22 AM UTC-6 [email protected] wrote:
>
>> tis 2022-01-04 klockan 16:54 +0100 skrev Stefan Skoglund: 
>> > I have a error in my policy such that cf-agent on the hub eats up all 
>> > memory (a virtual machine with 5G of RAM allocated) and when crashes 
>> > with xrealloc: 
>> > --- 
>> >   notice: Q: "...ne/bin/git pull": Already up to date. 
>> > xreallocCRITICAL: Unable to allocate memory 
>> > --- 
>> > 
>> > This is enterprise 18.1. 
>> > 
>> > How to debug ? 
>> > 
>> > Do cf-agent pulls down data from the clients or is it cf-hub who does 
>> > that ? 
>> > 
>>
>> answering to myself, i have a policy which load data_state() into an 
>> container in pass 1 and then it is redone in pass 2. 
>>
>> I wanted the classes part from data_state which is then used in a 
>> custom template_data container. 
>>
>> It isn't the first time i have tried this..... 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/d5dd02b3-a3c3-4ab0-9972-92366ee40723n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.