Update node revision programmatly If i try to update node revision like this:

$node = node_revision_load(59);
$node-&gt;set('publish_on', null);
$node-&gt;save();


or simple save:

$node = node_revision_load(59);
$node-&gt;save();


I have a PHP memory error, (i have 1gb allocated)
When you load a node, you should always check if it exists (is not null) before calling a method:

$node = node_revision_load(59);
if ($node) {
  $node-&gt;set('publish_on', null);
  $node-&gt;save();
}


But this is not the cause for the memory error. This is more likely a recursive thing. For example you are saving again and again until the memory is filled up.