Skip to content

State Registration Memory Consumption #2883

Closed
@dneri-accesso

Description

@dneri-accesso

When working with many state definitions (1000+) we're noticing huge memory consumption caused by UI Router.

For example, modifying stateSpec.js to include an additional 10000 simple states causes the memory to balloon considerably. This is a problem for larger applications that have very large test suites.

$stateProvider.state('root.sub2', {url: '/2?param2' });

for( var i = 0; i < 10000; i ++) {
  $stateProvider.state('iState' + i, {url: '/Statei' + i});
}

$provide.value('AppInjectable', AppInjectable);

Memory consumed continues to climb past 3 GB

image

Could someone help me understand why UI Router is allocating so much memory?

Tested against:
Node 4.4.7 & Node 5.10.0
Karma 0.12.37
UI Router 0.3.1 (haven't been able to build the master branch successfully, perhaps someone can test there)

Possibly related to #545

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions