-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Use lower threshold for NumericDictionary fast store (#125) (
#125) Summary: User lower fast store size threhosld for NumericDictionary as per OSS feedback: #125 Closes #125 Reviewed By: twobassdrum Differential Revision: D61559911 fbshipit-source-id: 91eda9d9d04f9cdc8e9b339c26a8612c34cd82e2
- Loading branch information
1 parent
69e87a7
commit 88bce92
Showing
13 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/cli/src/options/heap/HeapParserDictFastStoreSizeOption.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
* @oncall web_perf_infra | ||
*/ | ||
|
||
import type {ParsedArgs} from 'minimist'; | ||
import type {MemLabConfig} from '@memlab/core'; | ||
import {BaseOption, utils} from '@memlab/core'; | ||
import optionConstants from '../lib/OptionConstant'; | ||
|
||
export default class HeapParserDictFastStoreSizeOption extends BaseOption { | ||
getOptionName(): string { | ||
return optionConstants.optionNames.HEAP_PARSER_DICT_FAST_STORE_SIZE; | ||
} | ||
|
||
getDescription(): string { | ||
return ( | ||
'the size threshold for swtiching from fast store to slower store in ' + | ||
'the heap snapshot parser. The default value is 5,000,000. If you get ' + | ||
'the `FATAL ERROR: invalid table size Allocation failed - JavaScript ' + | ||
'heap out of memory` error, try to decrease the threshold here' | ||
); | ||
} | ||
|
||
getExampleValues(): string[] { | ||
return ['500000', '1000000']; | ||
} | ||
|
||
async parse(config: MemLabConfig, args: ParsedArgs): Promise<void> { | ||
if (this.getOptionName() in args) { | ||
const sizeThreshold = parseInt(args[this.getOptionName()], 10); | ||
if (!isNaN(sizeThreshold)) { | ||
if (sizeThreshold <= 0 || sizeThreshold > 10_000_000) { | ||
utils.haltOrThrow( | ||
`Invalid value for ${this.getOptionName()}: ${sizeThreshold}. ` + | ||
'Valid range is [1, 10_000_000]', | ||
); | ||
} | ||
config.heapParserDictFastStoreSize = sizeThreshold; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters