facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
818 stars 514 forks source link

use too many memory #488

Closed zerowjz closed 5 years ago

zerowjz commented 5 years ago

$fields = ['account_id', 'campaign_id', 'adset_id', 'ad_id', 'reach', 'impressions', 'spend', 'clicks', 'actions', 'action_values', 'inline_link_clicks', 'unique_actions']; $breakdowns = $this->getBreakdownsConfig($type); $fields = array_merge($fields, $breakdowns); $this->initApi($accountId, $userId); $report = new AdReportRun($jobId); $response = $report->getInsights($fields, ['limit' => 1000]); $response->setUseImplicitFetch(true); $result = []; foreach ($response as $value) { $rawData = $value->getData(); $data = $this->exportData($rawData, $fields); $result[] = $this->$data; $i++; }

while i push about 10000 rows it use about 200M memory

most spent on fetch object's fields i only want to get the field what i wanted

how to control the sdk return ?

jingping2015 commented 5 years ago

Since we want to handle bugs more efficiently, we've decided to close issue reporting in Github and move to our dedicated bug reporting channel. If you encounter a bug with Business SDK (PHP), please report the issue at our developer bug reporting channel.