Mach-II 1.6 Memory Footprint

4 views
Skip to first unread message

Hussein Grant

unread,
May 8, 2008, 10:39:50 AM5/8/08
to Mach-II for ColdFusion
Hi,

I was recently using the new flex server monitor in ColdFusion 8 and
noticed that a single Mach-II application utilizes around 20mb in the
Application scope memory. To ensure that this just wasn't my
particular application doing something weird, I downloaded the Mach-II
pet market sample, started it up and got a similar reading. The thing
is, this is just "one" simple app. I wonder what would happen if I
started up a huge multi level application. Would 20mb be multiplied by
the number of sub apps I have running? If that is the case wouldn't
this be really pushing it? Or is there a better way to setup sub
applications without assigning a new MachII_App_Key, therefore
minimizing the creation of dozens of app instances?

Thanks,
Hussein

Matt Woodward

unread,
May 8, 2008, 11:15:43 AM5/8/08
to mach-ii-for...@googlegroups.com
Be aware there is a baseline memory utilization for the framework, so
no, this wouldn't be 20MB multiplied by the number of apps.

Mach-II is used on numerous large, high-traffic applications so you
needn't worry there are any gross inefficiencies in the framework
itself.

--
Matt Woodward
mpwoo...@gmail.com
http://www.mattwoodward.com

Please do not send me proprietary file formats such as Word,
PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Hussein Grant

unread,
May 8, 2008, 3:26:07 PM5/8/08
to Mach-II for ColdFusion
Thank you.

On May 8, 11:15 am, "Matt Woodward" <mpwoodw...@gmail.com> wrote:
> Be aware there is a baseline memory utilization for the framework, so
> no, this wouldn't be 20MB multiplied by the number of apps.
>
> Mach-II is used on numerous large, high-traffic applications so you
> needn't worry there are any gross inefficiencies in the framework
> itself.
>
>
>
> On Thu, May 8, 2008 at 10:39 AM, Hussein Grant <hussein.gr...@gmail.com> wrote:
>
> > Hi,
>
> > I was recently using the new flex server monitor in ColdFusion 8 and
> > noticed that a single Mach-II application utilizes around 20mb in the
> > Application scope memory. To ensure that this just wasn't my
> > particular application doing something weird, I downloaded the Mach-II
> > pet market sample, started it up and got a similar reading. The thing
> > is, this is just "one" simple app. I wonder what would happen if I
> > started up a huge multi level application. Would 20mb be multiplied by
> > the number of sub apps I have running? If that is the case wouldn't
> > this be really pushing it? Or is there a better way to setup sub
> > applications without assigning a new MachII_App_Key, therefore
> > minimizing the creation of dozens of app instances?
>
> > Thanks,
> > Hussein
>
> --
> Matt Woodward
> mpwoodw...@gmail.comhttp://www.mattwoodward.com

Peter J. Farrell

unread,
May 8, 2008, 3:50:44 PM5/8/08
to mach-ii-for...@googlegroups.com
Also, remember that except for the RequestHandler, EventContext and Event objects which are created for each request, the entire framework is loaded as singletons.

.Peter

-----Original Message-----
From: Hussein Grant <hussei...@gmail.com>

Date: Thu, 8 May 2008 12:26:07
To:Mach-II for ColdFusion <mach-ii-for...@googlegroups.com>
Subject: [Mach-II] Re: Mach-II 1.6 Memory Footprint

Hussein Grant

unread,
May 14, 2008, 12:28:25 PM5/14/08
to Mach-II for ColdFusion
Thanks for the reply. I have another question although not related to
Mach-II specifically. I am experimenting with Hierarchical components
and Dependency Injection. I ran into a strange scenario whereby my
sample application's memory grows at a crazy rate every time a new
instance (reason why I thought it was Mach-II, but it is not). There
is absolutely no real data in my sample components, just some dummy
functions. It has gotten to 1mb. I am most likely doing something
wrong but wonder if anyone has ever experienced similar situations and
the remedy for such. Sorry but I can't post a sample, there is too
much all over the place since it is still experimental, but maybe
something mentioned here from another's own experience might turn on
the light bulb in my mind.
Any thoughts in general as to what could cause bloated memory usage by
components could help too, It doesn't have to be specific to my case.
I couldn't find anything to help online so this is my somewhat last
resort. Thanks in advance.

Hussein Grant

unread,
May 14, 2008, 12:30:04 PM5/14/08
to Mach-II for ColdFusion
Correct "It has gotten to 1mb...."
I meant 1GB.

Hussein Grant

unread,
May 15, 2008, 1:00:32 PM5/15/08
to Mach-II for ColdFusion
An update.

I'm doing something similar to how the Application Manager object
instance is copied to all the sub managers in Mach-II. I realized that
when I removed each referenced copy of the main component instance
from my sub components, the memory decreases by 20 MB plus. What the
Hell? There is hardly anything in there to begin with. I hope I'm not
being an annoyance, but I feel this is not something very common with
Coldfusion. I've taken my test App out of Mach-II and the results are
the same. I will try dismantling the whole thing and reassemble
consciously and hope I can fine the buggy culprit. Any suggestions are
still welcomed.

Brian Kotek

unread,
May 15, 2008, 3:20:54 PM5/15/08
to mach-ii-for...@googlegroups.com
There are bugs in the memory tracking with large CFC-based apps. If you turn it on and then init an app you'll see totally ridiculous memory usage values, but if you init the app and then turn it on and run some normal requests I usually see more realistic numbers.

Hussein Grant

unread,
May 17, 2008, 11:12:29 AM5/17/08
to Mach-II for ColdFusion
Hi Brain,

I've tried it and it does do as you say, however it still didn't
decrease the memory utilized to a reasonable level. I may have to try
a totally different approach to get around this.

Thanks,
Hussein

On May 15, 3:20 pm, "Brian Kotek" <brian...@gmail.com> wrote:
> There are bugs in the memory tracking with large CFC-based apps. If you turn
> it on and then init an app you'll see totally ridiculous memory usage
> values, but if you init the app and then turn it on and run some normal
> requests I usually see more realistic numbers.
>
> On Wed, May 14, 2008 at 12:28 PM, Hussein Grant <hussein.gr...@gmail.com>

Brian Kotek

unread,
May 17, 2008, 4:27:26 PM5/17/08
to mach-ii-for...@googlegroups.com
What is a "reasonable level"? If you're really seeing 20 Mb of application scope usage then I'd say something else is going on. In my experience, even large apps with lots of application-scoped component instances rarely gets above 100k.

Hussein Grant

unread,
May 18, 2008, 11:30:35 PM5/18/08
to Mach-II for ColdFusion
A reasonable level in my opinion would be below 1MB. What started me
on this crazy venture to begin with was the fact I was getting some
really big numbers (around 20MB) in Mach-II when I started up one
small application. Now the more listeners I added that number seemed
to jump even higher, so What I did in essence (call me crazy) was to
recreate the basic plumbing of Mach-II (no xml, no modules, nothing
fancy) where you have a Primary component (like the application
manager) and secondary child components (like the plugin manager) that
takes a copy of the Primary component for reference. I added a basic
BaseComponent, some other simple linkages and presto all working. I
created some components and got some really strange readings,
especially when I initialized over 30 dumb components. I did this to
see if I could recreate the same behavior with a more simplistic test.

After that little adventure I reverted to the original framework,
added about 10 dummy listeners, 7 dummy Plug-ins and the application-
scope memory jumped to over 200MB. I carried out a test on the
Plugin.cfc which extends the BaseComponent.cfc and calls the
"super.init(appManager, parameters)" function. What I've noticed is
that whenever I remove the reference to the application manager, the
size of the application decreased significantly.

Peter or Matt, I really think this is worth checking out and running
your own test. I sincerely hope I am wrong and this is nothing more
than a glitch on my end, that is the genuine truth.
Now I don't think this will cause a system crash under heavy load as
long as the system has moderate memory capacity. Mach-II load size
doesn't really grow once the entire application was initialized,
however I don't know how this would hold up with multiple large
applications on a single server given what I've just experienced.



On May 17, 4:27 pm, "Brian Kotek" <brian...@gmail.com> wrote:
> What is a "reasonable level"? If you're really seeing 20 Mb of application
> scope usage then I'd say something else is going on. In my experience, even
> large apps with lots of application-scoped component instances rarely gets
> above 100k.
>
> On Sat, May 17, 2008 at 11:12 AM, Hussein Grant <hussein.gr...@gmail.com>

Sean Corfield

unread,
May 19, 2008, 3:18:26 AM5/19/08
to mach-ii-for...@googlegroups.com
Sounds like the well-known bug in the Server Monitor that over-reports
memory usage for most application frameworks...

Hussein Grant

unread,
May 19, 2008, 8:45:00 AM5/19/08
to Mach-II for ColdFusion
Well that may be true but I ran some samples from ColdBox and the size
per application initialization was around 100K plus, hence what got me
started on this whole thing in the first place. If this is a bug then
what is the point of having tools that can't help you spot issues
during developing accurately or at least close enough.

On May 19, 3:18 am, "Sean Corfield" <seancorfi...@gmail.com> wrote:
> Sounds like the well-known bug in the Server Monitor that over-reports
> memory usage for most application frameworks...
>

Brian Kotek

unread,
May 19, 2008, 3:45:42 PM5/19/08
to mach-ii-for...@googlegroups.com
It is definitely the memory reporting issues with the server monitor. As I said, if you initialize everything first and THEN turn on the server monitor, in general it seems to report more normal numbers. The big caveat there is that you initialize everything first. Yes, the server monitory memory bug is annoying, but that's just the way it is right now.

Hussein Grant

unread,
May 19, 2008, 6:40:15 PM5/19/08
to Mach-II for ColdFusion
:) I restarted the server and gave your instructions a last try and
this time it finally came down to 192k. THANK YOU! THANK YOU! Curses
on the memory bug! LOL
This bug had me eating my finger nails for weeks. Thank you very much
Brain. Now back to some serious work.

On May 19, 3:45 pm, "Brian Kotek" <brian...@gmail.com> wrote:
> It is definitely the memory reporting issues with the server monitor. As I
> said, if you initialize everything first and THEN turn on the server
> monitor, in general it seems to report more normal numbers. The big caveat
> there is that you initialize everything first. Yes, the server monitory
> memory bug is annoying, but that's just the way it is right now.
>
> On Mon, May 19, 2008 at 8:45 AM, Hussein Grant <hussein.gr...@gmail.com>

Peter J. Farrell

unread,
May 19, 2008, 6:49:35 PM5/19/08
to mach-ii-for...@googlegroups.com
I hope you mean Brian, not Brain ;-). Although Brian has a good brain...

-----Original Message-----
From: Hussein Grant <hussei...@gmail.com>

Date: Mon, 19 May 2008 15:40:15
To:Mach-II for ColdFusion <mach-ii-for...@googlegroups.com>
Subject: [Mach-II] Re: Mach-II 1.6 Memory Footprint



Hussein Grant

unread,
May 19, 2008, 7:12:11 PM5/19/08
to Mach-II for ColdFusion
oh my goodness, haha, hmm, Sorry for the misspelling!

Hussein Grant

unread,
May 19, 2008, 7:23:34 PM5/19/08
to Mach-II for ColdFusion
Oh a small correction. The CF monitor showed the framework initialized
at 192 bytes and not 192KB. Wow! Is that realistic? Just curious.

Brian Kotek

unread,
May 19, 2008, 9:18:23 PM5/19/08
to mach-ii-for...@googlegroups.com
Happy to help and glad you got it sorted out.

Brian Kotek

unread,
May 19, 2008, 9:19:00 PM5/19/08
to mach-ii-for...@googlegroups.com
Ha! Thanks Peter! :-)
Reply all
Reply to author
Forward
0 new messages