You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sebb <se...@gmail.com> on 2016/08/13 15:45:25 UTC

Re: How to close the files opened by XPath function

On 19 July 2016 at 01:47, Joseph Roy <Jo...@resmed.com.au> wrote:
> Thanks Seb for the replay
>
> I am using jmeter 2.11 and java 8

That is quite old. You should consider upgrading, though I don't think
there have been changes to XPath.

> I see in the jmeter.log file while executing XPATH function a message 'opening file <filename>.xml'
> But I don’t see any message like 'closing file' like we see for CSV dataset config.

Not all file operations are logged.

> Okay so if it is stores in DOM, how do we release that DOM object to free up the memory.

Actually it stores the result of parsing the file and applying the
search function.

> I can see even after thread exits and test finishes memory is held up (DOM objects possible..)

Yes. The cache is only cleared at the start of a run.
Though fixing that won't help here.

> Is there any post processor or anything that I can used to free up unwanted/out of scope DOM objects so that I have room to run more XPATH functions.

That's not possible currently. There is a shared cache which cannot be
cleared until the test completes.

> Right now I am running out of memory or I have to configure really high -XMX heap parameter.
>
> Please suggest

Depends on why the XPATH function is being used.
If it is being used to provide test data, use CSV Dataset instead.
That is much more efficient.
If it is parsing sample response data, consider using a different
method of parsing the data.

> Thanks
> Joseph
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, 19 July 2016 9:11 AM
> To: JMeter Users List <us...@jmeter.apache.org>
> Subject: Re: How to close the files opened by XPath function
>
> On 18 July 2016 at 03:16, Joseph Roy <Jo...@resmed.com.au> wrote:
>> Hi All,
>>
>> I am using ${__XPath() function to parse and xml in my test plan. I am invoking this function in every thread. I have observed that each time thread invokes this function the file is opened once. Well,  my thread will do the job and exists but the file is not getting closed/or freeing the memory. I have observed that file is not getting closed even after test finishes. From Jmeter JVM heap I can see that it's not freeing up after GC cycles.
>
> Which version of JMeter are you using?
> And which version of Java?
>
> The code opens the file, parses it and stores the DOM, then closes the file.
>
>> Is it possible to close the files opened through XPath() after its use?
>
> See above; the files are already closed.
>
>> Please suggest
>> Joseph
>>
>>
>> Warning:  Copyright ResMed.  Where the contents of this email and/or
>> attachment includes materials prepared by ResMed, the use of those materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient.
>>
>> This communication is confidential and may contain legally privileged information.
>> By the use of email over the Internet or other communication systems,
>> ResMed is not waiving either confidentiality of, or legal privilege in the content of the email and of any attachments.
>> If the recipient of this message is not the intended addressee, please call ResMed immediately on  +61 2 8884 1000 Sydney, Australia.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
> Warning:  Copyright ResMed.  Where the contents of this email and/or attachment includes materials prepared by ResMed, the use of those
> materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient.
>
> This communication is confidential and may contain legally privileged information.
> By the use of email over the Internet or other communication systems, ResMed is not waiving either confidentiality of, or legal
> privilege in the content of the email and of any attachments.
> If the recipient of this message is not the intended addressee, please call ResMed immediately on  +61 2 8884 1000 Sydney, Australia.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


RE: How to close the files opened by XPath function

Posted by Joseph Roy <Jo...@resmed.com.au>.
Thanks Seb for clarifying how it works and the limitations

I will try different method for parsing the data

-Joseph

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: Sunday, 14 August 2016 1:45 AM
To: JMeter Users List <us...@jmeter.apache.org>
Subject: Re: How to close the files opened by XPath function

On 19 July 2016 at 01:47, Joseph Roy <Jo...@resmed.com.au> wrote:
> Thanks Seb for the replay
>
> I am using jmeter 2.11 and java 8

That is quite old. You should consider upgrading, though I don't think there have been changes to XPath.

> I see in the jmeter.log file while executing XPATH function a message 'opening file <filename>.xml'
> But I don’t see any message like 'closing file' like we see for CSV dataset config.

Not all file operations are logged.

> Okay so if it is stores in DOM, how do we release that DOM object to free up the memory.

Actually it stores the result of parsing the file and applying the search function.

> I can see even after thread exits and test finishes memory is held up 
> (DOM objects possible..)

Yes. The cache is only cleared at the start of a run.
Though fixing that won't help here.

> Is there any post processor or anything that I can used to free up unwanted/out of scope DOM objects so that I have room to run more XPATH functions.

That's not possible currently. There is a shared cache which cannot be cleared until the test completes.

> Right now I am running out of memory or I have to configure really high -XMX heap parameter.
>
> Please suggest

Depends on why the XPATH function is being used.
If it is being used to provide test data, use CSV Dataset instead.
That is much more efficient.
If it is parsing sample response data, consider using a different method of parsing the data.

> Thanks
> Joseph
>
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Tuesday, 19 July 2016 9:11 AM
> To: JMeter Users List <us...@jmeter.apache.org>
> Subject: Re: How to close the files opened by XPath function
>
> On 18 July 2016 at 03:16, Joseph Roy <Jo...@resmed.com.au> wrote:
>> Hi All,
>>
>> I am using ${__XPath() function to parse and xml in my test plan. I am invoking this function in every thread. I have observed that each time thread invokes this function the file is opened once. Well,  my thread will do the job and exists but the file is not getting closed/or freeing the memory. I have observed that file is not getting closed even after test finishes. From Jmeter JVM heap I can see that it's not freeing up after GC cycles.
>
> Which version of JMeter are you using?
> And which version of Java?
>
> The code opens the file, parses it and stores the DOM, then closes the file.
>
>> Is it possible to close the files opened through XPath() after its use?
>
> See above; the files are already closed.
>
>> Please suggest
>> Joseph
>>
>>
>> Warning:  Copyright ResMed.  Where the contents of this email and/or 
>> attachment includes materials prepared by ResMed, the use of those materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient.
>>
>> This communication is confidential and may contain legally privileged information.
>> By the use of email over the Internet or other communication systems, 
>> ResMed is not waiving either confidentiality of, or legal privilege in the content of the email and of any attachments.
>> If the recipient of this message is not the intended addressee, please call ResMed immediately on  +61 2 8884 1000 Sydney, Australia.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>
> Warning:  Copyright ResMed.  Where the contents of this email and/or 
> attachment includes materials prepared by ResMed, the use of those materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient.
>
> This communication is confidential and may contain legally privileged information.
> By the use of email over the Internet or other communication systems, 
> ResMed is not waiving either confidentiality of, or legal privilege in the content of the email and of any attachments.
> If the recipient of this message is not the intended addressee, please call ResMed immediately on  +61 2 8884 1000 Sydney, Australia.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Warning:  Copyright ResMed.  Where the contents of this email and/or attachment includes materials prepared by ResMed, the use of those
materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient.
 
This communication is confidential and may contain legally privileged information.
By the use of email over the Internet or other communication systems, ResMed is not waiving either confidentiality of, or legal
privilege in the content of the email and of any attachments.
If the recipient of this message is not the intended addressee, please call ResMed immediately on  +61 2 8884 1000 Sydney, Australia.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org