Jump to content

Out of memory


asunyer90

Recommended Posts

Hi!

I have in my hosting the last stable phpvms 2.1.934 and when I try to update the pilot's profile it shows me

Fatal error: Out of memory (allocated 149684224) (tried to allocate 11780 bytes) in/home/cargoita/public_html/xxx/core/classes/ezdb/ezdb_mysql.class.php on line 277

The most strange thing is that in another folder of my hosting, I have installed the last phpvms-dev and it doesn't give me this error on that page.

Is so wierd because I tried to update some files ( Like in the PIREP list from Admin center, I had the same problem of memory, but when I updated pireps_list and some others the problem was solved.) and it works.

Can someone explain me what or which files should I change / update to get the Pilot profile (admin) working and don't get this error.

I readed some topics here and it says that the problem is from the server, but definitely don't think so, because in the other folder (phpvms-dev) is working perfectly.

Thanks,

Albert.

Link to comment
Share on other sites

  • 3 weeks later...
  • Administrators

If you are using the TopPilot module I wrote a couple of years ago it is part of the reason for the increased memory usage. When I wrote it I did not figure on VA's having 10k + PIREPs in their database. Try removing that module and see if the memory usage declines some. There are also some other calculations that go on when a PIREP is accepted within the core of phpVMS. I have moved most of those to the daily maintenance function that is run using a cronjob for my own va.

I have been thinking that there needs to be a way to archive PIREPs that are older than X months or years and remove them from the main table.

Link to comment
Share on other sites

The part of the toppilot module that caused the wait is in a cronjob. Is there a list of which calculations are being done while accepting a pirep because there is a big problem. I was also thinking about a way to archive old pireps and already made a phpvms_pireps_2011 and phpvms_pireps_2012. Now I have to see which scripts need to be change so al will be working, but I am not a programmer so it can take a while :D

Cor

Link to comment
Share on other sites

I have been looking and concerning the pireps there is a lot of coding. Are there more people except simpilot who has problems with the fact that the pirepsdatabase is getting to big. Resethours will not work anymore at this time.

Cor

Link to comment
Share on other sites

mysql_query("update phpvms_pireps set rawdata='', log='', route='' where submitdate < DATE_SUB(NOW(), INTERVAL 3 MONTH)") or die(mysql_error());
;

i have added that to a cron job that runs once a month updating some other things as well on my databae. You can basically add it to any cron job you want to or create a new extra cronjob for it.

You might need to change phpvms_pireps to your correct table prefix.

Link to comment
Share on other sites

Tnx,

I will give it a go as soon as I am off work. i will let you know and trying to look for a permanent solution. Maybe as simpilot suggested, pireps older then a certain date being removed from

the main database. Maybe Nabeel has an solution :-)

Regards,

Cor

Link to comment
Share on other sites

Would this solution not skew the total va flight hours number? I display that on the front page of both VA's that I deal with using phpVMS. I could remove it, or just let it be knowing that the VA has actually flown more, but there has to be a better solution to this.

Link to comment
Share on other sites

Would this solution not skew the total va flight hours number? I display that on the front page of both VA's that I deal with using phpVMS. I could remove it, or just let it be knowing that the VA has actually flown more, but there has to be a better solution to this.

Thats what we have to look for. For me this was a temporary solution as the pirepsdata base will still grows. Not so fast as it did but it will grow.

Regards,

Cor

Link to comment
Share on other sites

Is anybody working on a solution for this? I know a little php (just about enough to be dangerous) but I don't know how php or mysql uses memory. Is this a php memory issue, or is it mysql causing problems? I have tried setting the php.ini to as high as 1024M with no luck in solving it. The strange thing is, flyalaska told me he has his set to 128M and has over 12000 pireps and doesn't get the error. Strange indeed.

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

I really could use some help on this issue. I am having to remove PIREPS from the db at an alarming rate and pilots are becoming a bit disgruntled over it. Please, somebody just give me some idea what to look at if you don't have time to look at it yourself. Not even responding, however, is really unprofessional and offputting. Please don't just leave your users hanging like this. I understand fully that this is offered free of charge, I get that. But if you intend to offer something, free or otherwise, don't you want satisfied "customers?" Sorry to rant, but this is a problem that has been around for quite some time, with zero response from anyone who might be able to help us.

Link to comment
Share on other sites

Not even responding, however, is really unprofessional and offputting. Please don't just leave your users hanging like this. I understand fully that this is offered free of charge,

I hate this kind of response. There was a solution given by mseiwald and I used that solotion and it works perfectly. It reduced my pirepdatabase to 100 MB (was 450MB).

I think that most people don`t have the problem anymore because of the solution,

Don´t say that the people here are unprofessional, that is not nice and will come back to you when you have other problems you need help with.

Regards,

Cor

Link to comment
Share on other sites

I didn't say the people were unprofessional. I said that not answering was unprofessional and it is. To me, mseiwald's solution is not really a solution, it is a temporary fix. I will use it, but I would like to at least know that someone is looking into the root problem. I even volunteered my help if someone would at least point me in a direction to look. There just has to be a way to make this program work correctly without a band aid.

Again, I don't mean to call anyone unprofessional, but I would like a response at least. Heck, just tell me it's not worth looking into if that's how you feel, but don't leave me hanging.

Link to comment
Share on other sites

  • Administrators

If you have set your memory limit as high as "1024M" and still get the error I would say that there are more issues than the phpVMS script. Either the override is not being used by the system, some hosts do not allow local php.ini overrides outside of the server root, the command may be in the wrong place, it is too late in the script to make a difference, or the server has a very low memory capacity.

If you are positive that the server is actually giving you that much memory you can start working your way through the functions that are parsed when you update a Pilots Profile on the admin side in the PilotAdmin.php file. I would start with line #158 -> https://github.com/phpVMS/phpVMS/blob/master/admin/modules/PilotAdmin/PilotAdmin.php#L158 - The updatetotalhours is notorious for causing issues for both pilot and airline statistics. Feel free to work on it and create a pull request on GitHub and it will be reviewed and merged in if it is benficial.

As far as the group being unprofessional, I do not know what to tell you, we are all volunteers that try to help when we can. I thought twice myself before posting this response figuring I am just going to get a backlash anyway, but I have tried to give you a direction to go per your request.

Link to comment
Share on other sites

Thank you for responding, David. I'm not sure why you would expect backlash. All I wanted was someone to at least respond, and let us know that you are at least aware of some of us experiencing this problem, and try to point me in some direction to look. You have done that and I am grateful. Again, I want to say that I am NOT calling anyone or any group unprofessional. That is uncalled for and I am sorry that some at least took it that way. I merely meant that the act, if you will, of not responding for a month and a half, to a post in a SUPPORT forum, is unprofessional. The act, not the person. But obviously, I have offended some, and for that I apologize.

As for the issue, the website in question is on a friend's server to which I have access. I did not use overrides, I have set the memory allocation in the php.ini file directly. The server is showing 2GB of memory and 1GB of virtual. That should be sufficient I would think. The thing that puzzles me is that flyalaska has more pireps in his db and sets his memory to a lower setting and has no problems.

I consider myself a novice at php but I am learning, and I will take a look now that I know where to look. I also have a friend who is a professional developer and I will try to get some advice from him.

Thanks again'

Brian

Link to comment
Share on other sites

Sorry for saying that to you but we are not obliged to help you and offer support in anything.

You are right, sir. You are not obligated to do so, but why then would you offer a support forum. So people can ask questions to which they will never receive an answer? I am sorry I offended you, I just wanted some help.

Link to comment
Share on other sites

  • 1 year later...
  • Administrators

Good evening to all, where to insert this string? thanks for any answer ...

mysql_query ("update phpvms_pireps September rawdata = '', log = ',' route = '' where submitdate <DATE_SUB (NOW (), INTERVAL 3 MONTH)") or die (mysql_error ());

You can use the

update phpvms_pireps rawdata = '', log = ',' route = '' where submitdate <DATE_SUB (NOW (), INTERVAL 3 MONTH)

part right in your phpMyAdmin interface for your database, or include it all in a php script within your system.

Link to comment
Share on other sites

  • 4 weeks later...

It does not work ... I put the string in the file ezdb_mysql.class.php Thanks for any response

   // Store Query Results
			while($row = mysql_fetch_object($this->result))
			{
				// Store relults as an objects within main array
				$this->last_result[$num_rows] = $row;
				$num_rows++;
			}

			mysql_query("update phpvms_pireps set rawdata='', log='', route='' where submitdate < DATE_SUB(NOW(), INTERVAL 3 MONTH)") or die(mysql_error());

			mysql_free_result($this->result);
		}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...