Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High Resource Usage- Probably memory leak on PHP 7.0 #17

Open
arjunsuresh opened this issue Oct 15, 2016 · 5 comments
Open

High Resource Usage- Probably memory leak on PHP 7.0 #17

arjunsuresh opened this issue Oct 15, 2016 · 5 comments

Comments

@arjunsuresh
Copy link

Hi, I was using this plugin and had no issue until I moved to PHP 7.0 on Ubuntu 16.04. Since then my site was crashing and finally it worked when I uninstalled social-share plugin. Not sure what the issue is as everything is normal on Ubuntu 14.04.

@amiyasahu
Copy link
Owner

Were you running on PHP 7 on Ubuntu 14.04 ?

@arjunsuresh
Copy link
Author

arjunsuresh commented Oct 15, 2016

Nopes, it was PHP 5.x. But the issue is not there on another Q2A site running on same server. So, I again tried debugging and pinned the problem to this part:

 if (!empty( $image_url ) ) {     
     $image_data = @getimagesize( $image_url );
     $imageOg = new OpenGraphProtocolImage();
     $imageOg->setURL( $image_url );
     $imageOg->setWidth( !empty( $image_data[0] ) ? $image_data[0] : 1200 );
     $imageOg->setHeight( !empty( $image_data[0] ) ? $image_data[0] : 630 );

     if ( !empty( $image_data['mime'] ) ) {
          $imageOg->setType( $image_data['mime'] );
      }
      $ogp->addImage( $imageOg );
}

The @getimagesize function call seem to cause the issue of memory leak but is not happening on another Q2A running on same server. All other plugins are the same too. :O

@amiyasahu
Copy link
Owner

Ok. I will take a look on this

@arjunsuresh
Copy link
Author

Thanks..

@rohitagarwal88
Copy link

@amiyasahu : Can I use the plugin, if the issue is fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants