> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getgc

> Returns an array table of live Luau garbage-collected objects visible to the API. Functions and userdata-like objects are included by default. Tables are included only when includeTables is true. get_gc_objects is an alias.

<div className="real-function-page">
  ```lua theme={null}
  getgc(includeTables?: boolean): table
  ```

  ## Aliases

  * `get_gc_objects`

  ## Arguments

  <ParamField path={"includeTables"} type={"boolean"}>
    Optional boolean. When true, live tables are included in addition to functions and userdata-like objects.
  </ParamField>

  ## Returns

  <ResponseField name={"objects"} type={"table"}>
    Array table containing matching live objects, plus live tables when includeTables is true.
  </ResponseField>

  ## Example

  Read the current GC object list, optionally including tables.

  ```lua theme={null}
  local objects = getgc()
  print(type(objects))

  local withTables = getgc(true)
  print(type(withTables))

  local aliasResult = get_gc_objects()
  print(type(aliasResult))
  ```
</div>
