contrueCT opened a new issue, #3466:
URL: https://github.com/apache/hugegraph/issues/3466

   ## Problem
   
   HG-Bench against an SF1 HStore graph caused the server JVM to exit with 
`OutOfMemoryError: Java heap space` during the shortest-path workload. The 
request used one concurrent query, `OUT/person_knows_person`, `max_depth=3`, 
`max_degree=-1`, and JSON string vertex IDs.
   
   The failure was reproduced with the same HugeGraph distribution outside the 
benchmark client. The shortest-path record path encodes string IDs through 
`ObjectIntMappingFactory`; the resulting sparse integer codes reach the 
fixed-address `IntMapBySegments` implementation. Each touched segment can 
allocate a 16,777,216-int array (64 MiB). Two sparse IDs were sufficient to 
trigger the allocation cascade under a 192 MiB diagnostic heap. Four nearby 
integer codes stayed in one segment and completed.
   
   This is a memory amplification problem caused by sparse record keys. It is 
not currently proven to be an object leak.
   
   ## Expected behavior
   
   Shortest-path queries with sparse numeric or string IDs should use memory 
proportional to the number of visited vertices and paths, without allocating 
large address-indexed arrays for a few sparse keys.
   
   ## Reproduction context
   
   - Apache master baseline used for the investigation: 
`9a8f066e66cd075e502c2378632dddff1c094a38` plus the then-current shortest-path 
changes.
   - Production-like diagnosis: Java 17, two active processors, 2 GiB server 
heap, HStore, one concurrent request.
   - The failure occurred on the third warm-up request; the server exited with 
code 3 and Docker did not report an OOM kill.
   
   ## Acceptance criteria
   
   - Sparse string and numeric IDs no longer cause fixed-address record 
allocation in shortest-path traversal.
   - Single shortest path, unreachable path, mixed ID types, and 
all-shortest-path behavior remain correct.
   - Regression tests cover sparse IDs and low-heap record growth.
   - The change is limited to shortest-path records unless a broader 
compatibility issue is demonstrated.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to