infiniflow / infinity

The AI-native database built for LLM applications, providing incredibly fast hybrid search of dense vector, sparse vector, tensor (multi-vector), and full-text
https://infiniflow.org
Apache License 2.0
2.6k stars 273 forks source link

[Bug]: Unreleased objects #2174

Open JinHai-CN opened 2 days ago

JinHai-CN commented 2 days ago

Is there an existing issue for the same bug?

Version or Commit ID

main

Actual behavior and How to reproduce it

  1. Change CMakeLists.txt as below:
    
    if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    ADD_DEFINITIONS(-D INFINITY_DEBUG)
    **ADD_DEFINITIONS(-D INFINITY_STATS)**
    endif()
2. Rebuild the project in debug mode
3. Run 
`python tools/run_pytest_parallel.py`
4. Use SQL to check allocated objects:

infiniflow=> show memory objects;
            name                | count 

------------------------------------+------- BindContext | 1 FragmentTask | 1 Config | 1 TxnContext | 1 PhysicalPlanner | 1 Storage | 1 ResourceManager | 1 SessionManager | 1 WalManager | 1 ClusterManager | 1 BlockingQueue: WalManager | 1 ResultCacheManager | 1 CleanupInfoTracer | 1 BufferManager | 1 ColumnVector | 3749 BGTaskProcessor | 1 InfinityContext | 1 Catalog | 1 BlockingQueue: BGTaskProcessor | 1 ExtraValueInfo | 160 BGMemIndexTracer | 1 WalEntry | 1 BlockingQueue: CompactionProcessor | 1 BaseMeta | 2154 PersistenceManager | 1 CompactionProcessor | 1 PeriodicTrigger | 5 RingBufferIterator | 636 FragmentContext | 1 Txn | 1 Value | 169 PlanFragment | 1 LogicalPlanner | 1 FileWorker | 297 TaskScheduler | 1 BlockingQueue: TaskScheduler | 16 TxnManager | 1 RemoteSession | 1 QueryContext | 1 Optimizer | 1 Worker | 16 FragmentBuilder | 1 BaseEntry | 4932 PhysicalOperator | 3 IndexBase | 1714 VectorBuffer | 3760 BufferObj | 297 (47 rows)



### Expected behavior

_No response_

### Additional information

_No response_
JinHai-CN commented 20 hours ago

After sqllogicaltest.py

                name                | count 
------------------------------------+-------
 BindContext                        |     1
 FragmentTask                       |     1
 Config                             |     1
 PhysicalPlanner                    |     1
 Storage                            |     1
 ResourceManager                    |     1
 SessionManager                     |     1
 WalManager                         |     1
 ClusterManager                     |     1
 BlockingQueue: WalManager          |     1
 ResultCacheManager                 |     1
 CleanupInfoTracer                  |     1
 BufferManager                      |     1
 ColumnVector                       |    20
 BGTaskProcessor                    |     1
 IndexBase                          |    -1
 InfinityContext                    |     1
 Catalog                            |     1
 BlockingQueue: BGTaskProcessor     |     1
 ExtraValueInfo                     |     6
 WalEntry                           |     1
 BGMemIndexTracer                   |     1
 TxnManager                         |     1
 BlockingQueue: CompactionProcessor |     1
 BaseMeta                           |     1
 PersistenceManager                 |     1
 CompactionProcessor                |     1
 PeriodicTrigger                    |     5
 RingBufferIterator                 |   636
 FragmentContext                    |     1
 Txn                                |     1
 Value                              |     6
 BaseResult                         |     1
 PlanFragment                       |     1
 LogicalPlanner                     |     1
 TaskScheduler                      |     1
 BlockingQueue: TaskScheduler       |    16
 RemoteSession                      |     1
 QueryContext                       |     1
 Optimizer                          |     1
 Worker                             |    16
 FragmentBuilder                    |     1
 BaseEntry                          |     1
 PhysicalOperator                   |     3
 VectorBuffer                       |    20
(45 rows)