Heap and RAM

2014-04-14 Thread John M Bliss

Here's a strange one:

We have one process that consumes a LOT of RAM. (It parses a huge XML
file.) It usually runs with no problem. Sometimes, it errors-out with a CF
out of Java heap space error. Not most days...just sometimes.

Last week, we added 2 GB of RAM to the server to bring the total up to 4 GB
and I bumped up CF's min/max heap size from 1 GB to 1.4 GB.

Since then, process in question has failed every day with out of Java heap
space error...until I restart the CF server service and run the process
right away after it restarts.

Any idea what's going on?

-- 
John Bliss - http://www.linkedin.com/in/jbliss


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358327
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Heap and RAM

2014-04-14 Thread Dave Watts

 We have one process that consumes a LOT of RAM. (It parses a huge XML
 file.) It usually runs with no problem. Sometimes, it errors-out with a CF
 out of Java heap space error. Not most days...just sometimes.

 Last week, we added 2 GB of RAM to the server to bring the total up to 4 GB
 and I bumped up CF's min/max heap size from 1 GB to 1.4 GB.

 Since then, process in question has failed every day with out of Java heap
 space error...until I restart the CF server service and run the process
 right away after it restarts.

The heap is not one big undifferentiated bucket of storage. It
contains different sections, or generations, that are used to store
different scopes of variables. Simply increasing the overall heap may
not have any effect on the amount of storage for this variable. Do you
have specified sizes for the young and perm generations? If not, you
might want to set them.

All that said, you might also want to switch to SAX parsing if you're
working with extremely large XML files. SAX parsing is (in my opinion)
a lot more programming work, but it's designed to let you solve this
sort of problem.

Dave Watts, CTO, Fig Leaf Software
1-202-527-9569
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358328
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Heap and RAM

2014-04-14 Thread John M Bliss

 Do you have specified sizes for the young and perm generations? If not,
you might want to set them.

No. How do I do that?


On Mon, Apr 14, 2014 at 9:21 AM, Dave Watts dwa...@figleaf.com wrote:


  We have one process that consumes a LOT of RAM. (It parses a huge XML
  file.) It usually runs with no problem. Sometimes, it errors-out with a
 CF
  out of Java heap space error. Not most days...just sometimes.
 
  Last week, we added 2 GB of RAM to the server to bring the total up to 4
 GB
  and I bumped up CF's min/max heap size from 1 GB to 1.4 GB.
 
  Since then, process in question has failed every day with out of Java
 heap
  space error...until I restart the CF server service and run the process
  right away after it restarts.

 The heap is not one big undifferentiated bucket of storage. It
 contains different sections, or generations, that are used to store
 different scopes of variables. Simply increasing the overall heap may
 not have any effect on the amount of storage for this variable. Do you
 have specified sizes for the young and perm generations? If not, you
 might want to set them.

 All that said, you might also want to switch to SAX parsing if you're
 working with extremely large XML files. SAX parsing is (in my opinion)
 a lot more programming work, but it's designed to let you solve this
 sort of problem.

 Dave Watts, CTO, Fig Leaf Software
 1-202-527-9569
 http://www.figleaf.com/
 http://training.figleaf.com/

 Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
 GSA Schedule, and provides the highest caliber vendor-authorized
 instruction at our training centers, online, or onsite.

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358329
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Heap and RAM

2014-04-14 Thread Dave Watts

  Do you have specified sizes for the young and perm generations? If not,
  you might want to set them.

 No. How do I do that?

More switches in jvm.config. If I recall correctly:

-XX:NewSize=
-XX:MaxNewSize=
-XX:PermSize=
-XX:MaxPermSize=

That said, I'd recommend that you don't just plug these in - read a
bit about them first. Oracle has a bunch of docs about heap sizing,
etc. You might actually want to profile your JVM too, to see what's
actually going on.

Dave Watts, CTO, Fig Leaf Software
1-202-527-9569
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358330
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Heap and RAM

2014-04-14 Thread Money Pit

Along the lines of Dave's original recommendation, here is a big leg up on
using StAX (not a spelling error... StAX = same idea as SAX to make long
story short)

http://jochem.vandieten.net/tag/stax/

The thread Jochem is referring to in his post was mine, and I used his code
and example to give me the ability to quickly and simply process a large
daily xml file roughly 295 mb in size, among others.

If you are accustomed to the processing times that go with large xml files,
you can knock that down by perhaps an order of magnitude or more.  This a
vastly superior method on many fronts.
-- 
--m@Robertson--
Janitor, The Robertson Team
mysecretbase.com


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358331
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Extending Application.CFC

2014-04-14 Thread Scott Stewart

On 4/11/2014 12:58 PM, Donnie Carvajal wrote:
 Hi,

 I have an application with a root application.cfc and a subfolder for IVR 
 access that also has an application.cfc which extends the root 
 application.cfc.  There are certain Application variables that I only need in 
 the IVR subfolder, so I added an onApplicationStart method to the subfolder 
 application.cfc.  I'm running into an issue in my IVR access indicating that 
 the IVR specific variables are not available.  This is because the root 
 application.cfc ran before the sub and the onApplicationStart method in the 
 sub application.cfc did not.

 Would you suggest putting all application variables in the Root 
 onApplicationStart method or add a check in subfolder onRequest method for 
 variables and call subfolder onApplicationStart if missing?

 Any best practices I'm missing?

 Thanks,

 Donnie

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358332
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm