Welcome Guest, Not a member yet? Register   Sign In
Memory usage question...
#11

[eluser]TheFuzzy0ne[/eluser]
Any views you load are buffered into RAM, could that explain the extra memory usage? See what happens when you remove the HTML from those files (or rather comment it out with PHP comments).
#12

[eluser]deanf7[/eluser]
I've mostly been autoloading everything I might need, but I was having the same thought you were. It's easier to program things without the manual load, but it might be too much of a performance drag.

It could be the HTML. I have a master template, that pulls the appropriate view into it. I've combined all my CSS into one file, and all my JS(3 largish libraries, jquery, plus some more or less custom libraries) into one file, and minified it. This seemed to speed things up some.
Is it possible to create a header partial and cache it?

Thanks
#13

[eluser]TheFuzzy0ne[/eluser]
Yes and no. Yes it's possible, but no, it wouldn't work because as soon as you include a file from within a view, it will still be buffered.
#14

[eluser]deanf7[/eluser]
That's too bad about the header partial.

I've discovered, at least one of my bottlenecks was my own stupidity, but in general it seems tied to using redirects instead of explicitly calling a file to load into the template
Code:
redirect('questionnaire/' . $page, 'refresh');
vs.
$this->load->view('template', $data)
#15

[eluser]jedd[/eluser]
[quote author="deanf7" date="1245356400"]Any suggestions general suggestions for reducing memory load on a page running 0 queries, but still using 2,732,616 bytes of memory. I develop on Windows and page loading is fine. The memory usage is very similar when I move it over to our dedicated Linux server, where the app. runs brutally slowly.[/quote]

Do we think that 3MB is a lot of memory? It's a large code base (CI) so you'd have a fairly linear growth rate per user code once you get over the CI hump, so to speak. Remember that on your average web server this equates to something less 0.15% of your RAM, for something less than a tenth of a second.

Instead of running your server application, was there something you'd rather the computer be doing with its memory?

If you want to track things, use the profiler class - and put marks throughout your code. Haven't tried this for memory usage, so not sure if that works as reliably as the elapsed time stuff. Something for someone (else) to find out and report back on.
#16

[eluser]deanf7[/eluser]
I don't really know. It was just that the app was running very slow, and I have no control over the web server as far as adding memory or a PHP accelerator(an ISP) This is the first application I've done in CI, so some it may just be clunky coding as I learn CI best practices.

I was asking as reading over the earlier messages in the thread they seemed to think 2mb was a large memory load.
#17

[eluser]jedd[/eluser]
Quote: ...they seemed to think 2mb was a large memory load.

This is the same 2MB that is .. uhm .. 1.3 floppy disks, right?

If you're concerned about performance, and you see an application taking up 3MB, you can pretty much instantly rule out memory as your problem (unless you're on a C=64) - in which case props to writing a VM system to get around the 38KB limitation.

But seriously ... if you're in doubt, you need to play with the bundled CI Profiler class - it's very powerful, and very good at showing you where your time is being taken up in the script (you just need to put in a few marks, as I mentioned). Have a read of the [url="http://ellislab.com/codeigniter/user-guide/general/profiling.html"]CI Profiling Library page[/url] - it's well documented.

If you are still stuck after that, then there's a nice little PHP Firebug extension I was starting to play with last week, but haven't got back to - it requires a library to be installed and loaded, and a plug-in to Iceweasel (sometimes called Firefox on lesser platforms) but promises to give some pretty gnarly statistics in return.




Theme © iAndrew 2016 - Forum software by © MyBB