Skip to content

Add four extra fields to gc_status() #9336

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

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

tstarling
Copy link
Contributor

@tstarling tstarling commented Aug 15, 2022

Exposing gc_active helped me to understand #9323. I thought I may as well just add all the GC globals.

Documentation for new fields:

  • running: true if garbage collection is currently running
  • protected: true if the garbage collector is protected and root additions are forbidden
  • full: true if the garbage collector buffer size exceeds GC_MAX_BUF_SIZE
  • buffer_size: current garbage collector buffer size

Documentation for existing fields:

  • runs: the number of times the garbage collector has been run
  • collected: the number of objects collected
  • threshold: the number of roots in the buffer which will trigger garbage collection
  • roots: the current number of roots in the buffer

Updated manual example output:

array(8) {
  ["running"]=>
  bool(false)
  ["protected"]=>
  bool(false)
  ["full"]=>
  bool(false)
  ["runs"]=>
  int(5)
  ["collected"]=>
  int(100002)
  ["threshold"]=>
  int(50001)
  ["buffer_size"]=>
  int(131072)
  ["roots"]=>
  int(0)
}

- running: true if garbage collection is currently running
- protected: true if the garbage collector is protected and root
  additions are forbidden
- full: true if the garbage collector buffer size exceeds GC_MAX_BUF_SIZE
- buffer_size: current garbage collector buffer size

Documentation for existing fields:

- runs: the number of times the garbage collector has been run
- collected: the number of objects collected
- threshold: the number of roots in the buffer which will trigger
  garbage collection
- roots: the current number of roots in the buffer

Updated manual example output:

array(8) {
  ["running"]=>
  bool(false)
  ["protected"]=>
  bool(false)
  ["full"]=>
  bool(false)
  ["runs"]=>
  int(5)
  ["collected"]=>
  int(100002)
  ["threshold"]=>
  int(50001)
  ["buffer_size"]=>
  int(131072)
  ["roots"]=>
  int(0)
}
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any problems.

@Girgias Girgias merged commit b8811d4 into php:master Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants