Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#35394 closed defect (bug) (invalid)

Memory usage increases for each call to wp_insert_post in 4.X

Reported by: winfieldco's profile winfieldco Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.1
Component: Posts, Post Types Keywords:
Focuses: Cc:


I've installed 4.4.1 and 3.7.

When I run a simple loop to that runs wp_insert_post,

The memory usage increases as the loop progresses in 4.4.1, whereas in 3.7 it stays the same.

This eventually leads to an out of memory error in 4.4.1. I believe this is a regression introduced in the 4.X version as it has always worked before.

To see this just add on each loop:

echo memory_get_usage()/1024.0 . " kb \n";

If you need to me write up some test code you can just add quickly to verify let me know. I will take a look through the wp_insert_code as well to see if I can find where the issue is myself. I've also tried the wp_suspend_cache_addition(true); as well as define( 'SAVEQUERIES', false ); But those do not effect the memory consumption. In any case, it still works fine in 3.X so I assume something changed.

Change History (2)

#1 @winfieldco
7 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Sorry, issue is with some custom code please ignore.

#2 @swissspidy
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.