Results 1 to 5 of 5
  1. #1

    Allocate memory error crating record

    Hi all
    I have a questiong about php memory_limit in sugarcrm. We are using sugarcrm 6.5 CE in a 4GB Ram server. We have set up php memory_limit to 2048M as we are getting the "allocate memory error" when we try to launch a custom code we built. This code takes Leads beans that match a condition and transforms them into new Contacts beans with specific values, also creates Accounts beans and then relate them (accounts-contacts). Process seems to be quite easy, as internal checks in the code before records and relation are created are quite simple.

    Problem is that now we need to launch a process for 700 leads....and always after a while it crashes with this error. I have been searching and seemed that it was related to the memory_limit value in php.ini, but after increasing, it takes longer, but error appears...and only 93 records are done so far.

    Any other suggestions I should start looking at? Could it be related to mysql instead apachea of sugarcrm?

    Thanks a lot, dont know what else to check.
    Regards


    No one else has this question

  2. #2

    Allocate memory error crating record

    Hi jlabuelo

    What is the version of installed PHP?
    Can you share the code behind this feature?

    Kind regards





    LikeShow 0 Likes
    Actions

  3. #3

    Allocate memory error crating record

    Hi André
    I realized that PHP version is 5.5.30. It is under lamp configuration as it is quite difficult to find an old php to install in a linux machine 64 bits nowadays. Do you think this could be the problem??

    Thanks!

  4. #4
    Content from reference site

  5. #5

    Allocate memory error crating record

    I would change this piece of code:

    $contact_aux->load_relationship('contacts_oms2b_pagocuotas_1');
    $cuotas_id = $contact_aux->contacts_oms2b_pagocuotas_1->get();


    foreach ($cuotas_id as $cuota_id) {
    $cuota = new OMS2B_PagoCuotas();
    $cuota->retrieve($cuota_id);
    if ($cuota->estado_pago === VOLVERACARGAR) {

    $cuota->name = $this->bean->name . ' - ' . $cuota->name;
    $cuota->save();
    $cuota->load_relationship('oms2b_facturacion_oms2b_pagocuotas_1');
    $cuota->oms2b_facturacion_oms2b_pagocuotas_1->add($this->bean);
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •