BOM Compare utility export fails with Java heap space error

We’re experiencing consistent Java heap space errors when attempting to export large EBOM structures using the BOM Compare utility in TC 12.3. Our typical assemblies contain 8,000-12,000 components with 6-7 levels of nesting. The export starts processing but fails around 60-70% completion.

Current JVM settings are at default values (-Xmx2048m). We’ve noticed the issue particularly affects recursive EBOM structures where components reference sub-assemblies multiple times. The batch export option doesn’t seem to help - same error occurs.

Error snippet from the log:


java.lang.OutOfMemoryError: Java heap space
at com.teamcenter.bom.compare.ExportHandler.processNode(ExportHandler.java:342)
at com.teamcenter.bom.compare.ExportHandler.traverseStructure(ExportHandler.java:289)

We’ve also customized several BMIDE properties for BOM lines but unsure if that’s contributing. Has anyone successfully tuned memory settings or modified the export approach for large structures?

Let me provide a comprehensive solution addressing all the factors contributing to your heap space errors.

JVM Memory Tuning: For EBOM structures of your size, configure these JVM parameters in your method server startup script:


-Xms4096m -Xmx8192m
-XX:+UseG1GC
-XX:MaxGCPauseMillis=200
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps

Start with 8GB heap maximum. The G1 garbage collector handles large heaps more efficiently than the default collector. Monitor the GC logs to see actual memory usage patterns - you may need to adjust further for your specific data.

Recursive EBOM Structure Optimization: The key issue is how BOM Compare handles shared sub-assembly references. By default, it loads each occurrence separately into memory. Modify your export approach:

  1. Enable structure sharing detection in preference settings (if available in 12.3)
  2. Pre-process your BOM to identify highly-referenced sub-assemblies (referenced >10 times)
  3. For these common sub-assemblies, export them separately first, then reference them in the main export

You can identify recursive patterns with this query approach:


// Query to find highly-referenced components
SELECT child_id, COUNT(*) as ref_count
FROM PSEBOMViewRevision
WHERE parent_structure_id = 'your_top_assembly'
GROUP BY child_id
HAVING COUNT(*) > 10

Batch Export Configuration: The batch export in TC 12.3 doesn’t help with single large structures, but you can implement a pseudo-batch approach:

  1. Configure BOM Compare to export by assembly level rather than full traversal
  2. Set max_traversal_depth in your site preferences to limit recursive depth per export operation
  3. Export levels 1-3, then 4-6, then merge results

BMIDE Property Configuration: Review your custom BOM line properties. Check these specific areas:

  1. Computed Properties: Disable or cache any properties that perform calculations during load. Set them to load-on-demand rather than load-with-object.

  2. Property Definitions: In BMIDE, verify that your custom properties have appropriate loading policies:


<property name="custom_cost">
  <loading-policy>ON_DEMAND</loading-policy>
  <caching-policy>CACHE_ENABLED</caching-policy>
</property>
  1. Effectivity Properties: If you’re using custom effectivity, ensure they’re not triggering recursive database queries for each BOM line.

Database Connection Pool: Adjust these properties in wt.properties:


wt.pom.dbcp.maxActive=100
wt.pom.dbcp.maxIdle=50
wt.pom.dbcp.maxWait=180000

Larger pools prevent connection waits that cause memory buildup.

Monitoring and Validation: After implementing these changes:

  1. Enable verbose logging for BOM Compare operations
  2. Monitor heap usage during export with JConsole or VisualVM
  3. Track export completion times and memory peaks
  4. Test with progressively larger structures (5K, 8K, 10K, 12K components)

Alternative Approach: If memory issues persist even after tuning, consider using the Teamcenter SOA API to build a custom export utility that streams data rather than loading everything into memory. This gives you full control over memory management and allows processing structures of any size.

The combination of proper JVM tuning, recursive structure optimization, and BMIDE property configuration should resolve your heap space errors for structures up to 15K components. For anything larger, the custom streaming export approach becomes necessary.

Your BMIDE customizations might be adding overhead. Each custom property on BOM lines gets loaded into memory during export. Check your PSE configurations - if you’ve added computed properties or properties that trigger queries, those execute for every line item. We had a similar issue where a custom effectivity property was causing recursive database calls. Review what’s actually needed for export versus what’s just display properties in the UI.

Thanks for the suggestions. We increased heap to 4GB but still seeing failures on our largest assemblies (10K+ components). The recursive reference point is interesting - we do have several standard sub-assemblies referenced 20-30 times throughout the structure. Is there a way to configure BOM Compare to handle shared references more efficiently, or do we need custom code?

The recursive structure handling is likely your main bottleneck. BOM Compare loads the entire structure into memory before export. For assemblies with multiple references to the same sub-assemblies, you’re essentially loading those components multiple times. We modified our export process to flatten the structure first, which reduced memory consumption by about 40%. The batch export option in TC 12.3 doesn’t actually chunk the memory load - it just processes multiple BOMs sequentially. Not helpful for your single large structure scenario.

Consider implementing a chunked export strategy rather than trying to export the entire structure at once. We built a custom utility that breaks the BOM into logical segments based on first-level assemblies, exports each segment separately, then merges the results. Not ideal but works for structures over 15K components.