How much memory is too much?

How much memory consume your projects? how much memory is too much ?

When you develop something, what is the memory consumption limit you should aim to?

That is just like asking how much sugar should go into tea.

It depends on evryone’s taste and by taste I mean the application’s functionality.

But I think that, for most applications, memory footprint is a secondary issue. Usually you first hit a barrier on the db (because A: memcached fills its buffers too soon or B: You don’t cache/denormalize enough).

In fact the only time I experienced memory becoming an issue was once on an app that spiked and started getting about 100 hits each second but that was on a VM that only had 0.5GB free memory after OS and services loaded so the spike was handeled by the hosting provider. Also I should note that that was a joomla project so the numbers are irrelevant. The quick solution was to add ram (ie: put the VM on a different $plan). On a later date I did some memory streamlining but that didn’t actually do much (avg memory footprint from ~10.1MB to ~9.4MB).

On another note I might just have done it wrong :slight_smile:

EDIT: Since you asked, what memory requirements does your app have?

EDIT2:If you really need to keep memory under controll it could mean that one or two requests have high memory needs. This usually translates to image/video processing and maintainance (eg: reindexing) actions. these usually can be put iside a que so that they don’t overwhelm your system.

For now the memory is not an issue…

But for example I know added a ban option…

so in every controller "beforeAction" if user not guest, I should check every time if user not banned…

if so - to kick him out ;)

If I use it with dao, I can save about 250 kb(the second one uses simple createCommand),




$this->_user = User::model()->findByPk(Yii::app()->user->id);						 

			$this->_user =  self::getUserData(Yii::app()->user->id, 

						   array('authKey', 'ip', 'userAgent', 'ban'));