Memory leak?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Memory leak?

John Preimonas-2
Hi eXist-db folk,

I am getting some unusual results from my rebuilt database.
I just added two new xml files and the behaviour of these two files is strange and screwing up the rest of my database application. Somehow the same two elements in these xml files are being ‘combined’ when I run queries, which then produce unexpected errors/failures.

When I run this query:

for $expenses in collection(‘/db/apps/(..rest of collection name..)/expenses’)//expense
order by xs:integer($expenses/expid) descending
return <div>amount={$expenses/expamount}</div>

I get the following results (please note the joined elements attached to the first two results, and not to the rest of the results):
1
<div>id=
<expclub>BGC</expclub>
<expamount>30.76</expamount>
</div>
2
<div>id=
<expclub>BGC</expclub>
<expamount>0</expamount>
</div>
3
<div>id=
<expamount>200</expamount>
</div>
4
<div>id=
<expamount>70.6</expamount>
</div>

When I change the query to:

for $expenses in collection('/db/apps/JPGlidersUser/modules/data/M-09870/expenses')//expense
order by xs:integer($expenses/expid) descending
return <div>amount={$expenses}</div>

the results appear normal, i.e. as I expect them to be:
1
<div>amount=
<expense>
<expid>515</expid>
<expdate>2017-03-26</expdate>
<expclub>BGC</expclub>
<exptype>DB</exptype>
<expamount>30.76</expamount>
<expdetails>Flt No:367; flt 6.96 tow 23.8 Mutual-P2</expdetails>
</expense>
</div>
2
<div>amount=
<expense>
<expid>514</expid>
<expdate>2017-03-26</expdate>
<expclub>BGC</expclub>
<exptype>DB</exptype>
<expamount>0</expamount>
<expdetails>Flt No:366; flt 0 tow 0 AEF</expdetails>
</expense>
</div>
3
<div>amount=
<expense>
<expid>513</expid>
<expdate>2017-03-05</expdate>
<expclub>BGC</expclub>
<exptype>CR</exptype>
<expamount>200</expamount>
<expdetails>Flying fees </expdetails>
</expense>
</div>
4
<div>amount=
<expense>
<expid>512</expid>
<expdate>2017-03-05</expdate>
<expclub>BGC</expclub>
<exptype>DB</exptype>
<expamount>70.6</expamount>
<expdetails>Flt No:365; flt 39.15 tow 31.45 Mutual-P2</expdetails>
</expense>
</div>

the <expclub> element appears normal, and ’disappears’ from the <expamount>.

When I check the individual xml files, the files appear as expected (i.e. similar to results  3 and 4 above) - no joining of expclub with expamount.

But when I try and run an Xquery, I get the following error message:
<exception><path>/db/apps/JPGlidersUser/modules/views/expenses-all.xq</path>
<message>err:FORG0001 cannot construct xs:double from ‘BGC’ [at line 1264, column 37, source: /db/apps/(,,rest of collection name..)/resources/glidingFunctions.xqm]
In function:
gFn:expensesBalance() [36:14:/db/apps/(,,rest of collection name..)/resources/glidingFunctions.xqm]</message>
</exception>
It’s because <expclub> and <expamount> are somehow joined into a single expression with a string and decimal combined. Weird.

Technical details:
eXist: 3.1
 System Version: macOS 10.12.3 (16D32)
  Model Name: iMac
  Model Identifier: iMac11,3
  Processor Name: Intel Core i3
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 2
  L2 Cache (per Core): 256 KB
  L3 Cache: 4 MB
  Memory: 12 GB
  Processor Interconnect Speed: 5.86 GT/s
  Boot ROM Version: IM112.0057.B03
  SMC Version (system): 1.59f2

What is happening to my data;  how to I fix the problem; and, more importantly, how do I prevent it from happening again?

Cheers,
John Preimonas


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Memory leak? [fixed]

John Preimonas-2
Hi all,
Please disregard this problem. I seem to have resolved it. I deleted the damaged xml files, shutdown the Dashboard, reset the next-id number expenses, and then reentered the values via my XQuery and forms, checking each entry. They all were created correctly and do not appear to have the strange internal linkages between elements. Strange, but glad it has resolved itself.
Regards,
JohnP

Begin forwarded message:

From: John Preimonas <[hidden email]>
Subject: Memory leak?
Date: 2 April 2017 at 8:06:53 pm AEST
To: exist-open <[hidden email]>

Hi eXist-db folk,

I am getting some unusual results from my rebuilt database.
I just added two new xml files and the behaviour of these two files is strange and screwing up the rest of my database application. Somehow the same two elements in these xml files are being ‘combined’ when I run queries, which then produce unexpected errors/failures.

When I run this query:

for $expenses in collection(‘/db/apps/(..rest of collection name..)/expenses’)//expense
order by xs:integer($expenses/expid) descending
return <div>amount={$expenses/expamount}</div>

I get the following results (please note the joined elements attached to the first two results, and not to the rest of the results):
1
<div>id=
<expclub>BGC</expclub>
<expamount>30.76</expamount>
</div>
2
<div>id=
<expclub>BGC</expclub>
<expamount>0</expamount>
</div>
3
<div>id=
<expamount>200</expamount>
</div>
4
<div>id=
<expamount>70.6</expamount>
</div>

When I change the query to:

for $expenses in collection('/db/apps/JPGlidersUser/modules/data/M-09870/expenses')//expense
order by xs:integer($expenses/expid) descending
return <div>amount={$expenses}</div>

the results appear normal, i.e. as I expect them to be:
1
<div>amount=
<expense>
<expid>515</expid>
<expdate>2017-03-26</expdate>
<expclub>BGC</expclub>
<exptype>DB</exptype>
<expamount>30.76</expamount>
<expdetails>Flt No:367; flt 6.96 tow 23.8 Mutual-P2</expdetails>
</expense>
</div>
2
<div>amount=
<expense>
<expid>514</expid>
<expdate>2017-03-26</expdate>
<expclub>BGC</expclub>
<exptype>DB</exptype>
<expamount>0</expamount>
<expdetails>Flt No:366; flt 0 tow 0 AEF</expdetails>
</expense>
</div>
3
<div>amount=
<expense>
<expid>513</expid>
<expdate>2017-03-05</expdate>
<expclub>BGC</expclub>
<exptype>CR</exptype>
<expamount>200</expamount>
<expdetails>Flying fees </expdetails>
</expense>
</div>
4
<div>amount=
<expense>
<expid>512</expid>
<expdate>2017-03-05</expdate>
<expclub>BGC</expclub>
<exptype>DB</exptype>
<expamount>70.6</expamount>
<expdetails>Flt No:365; flt 39.15 tow 31.45 Mutual-P2</expdetails>
</expense>
</div>

the <expclub> element appears normal, and ’disappears’ from the <expamount>.

When I check the individual xml files, the files appear as expected (i.e. similar to results  3 and 4 above) - no joining of expclub with expamount.

But when I try and run an Xquery, I get the following error message:
<exception><path>/db/apps/JPGlidersUser/modules/views/expenses-all.xq</path>
<message>err:FORG0001 cannot construct xs:double from ‘BGC’ [at line 1264, column 37, source: /db/apps/(,,rest of collection name..)/resources/glidingFunctions.xqm]
In function:
gFn:expensesBalance() [36:14:/db/apps/(,,rest of collection name..)/resources/glidingFunctions.xqm]</message>
</exception>
It’s because <expclub> and <expamount> are somehow joined into a single expression with a string and decimal combined. Weird.

Technical details:
eXist: 3.1
 System Version: macOS 10.12.3 (16D32)
  Model Name: iMac
  Model Identifier: iMac11,3
  Processor Name: Intel Core i3
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 2
  L2 Cache (per Core): 256 KB
  L3 Cache: 4 MB
  Memory: 12 GB
  Processor Interconnect Speed: 5.86 GT/s
  Boot ROM Version: IM112.0057.B03
  SMC Version (system): 1.59f2

What is happening to my data;  how to I fix the problem; and, more importantly, how do I prevent it from happening again?

Cheers,
John Preimonas



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...