Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(examples): supply chain backend bundle build RAM #766

Closed
petermetz opened this issue Apr 2, 2021 · 0 comments · Fixed by #797
Closed

fix(examples): supply chain backend bundle build RAM #766

petermetz opened this issue Apr 2, 2021 · 0 comments · Fixed by #797
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@petermetz
Copy link
Contributor

Describe the bug

Need to allocate at least 4 gigs of RAM to the webpack production bundle build process for the supply chain backend package because right now, without that it crashes with the default 2 gigs that NodeJS allocates.

To Reproduce

Try and build the production bundles without specifying the RAM as 4 gigs or more

Expected behavior

Build should succeed.

Logs/Stack traces

webpack 5.16.0 compiled with 71 warnings in 46569 ms
lerna ERR! npm run webpack:prod:node exited 134 in '@hyperledger/cactus-example-supply-chain-backend'
lerna ERR! npm run webpack:prod:node stdout:

> @hyperledger/cactus-example-supply-chain-backend@0.4.1 webpack:prod:node **REDACTED_PATH**cactus-origin/examples/cactus-example-supply-chain-backend
> webpack --env=prod --target=node --config ../../webpack.config.js


<--- Last few GCs --->

[41474:0x3df2d30]    96871 ms: Mark-sweep 2044.1 (2066.5) -> 2037.4 (2052.7) MB, 699.7 / 0.0 ms  (+ 0.1 ms in 169 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 734 ms) (average mu = 0.121, current mu = 0.047) allocatio[41474:0x3df2d30]    97493 ms: Mark-sweep 2042.4 (2052.7) -> 2039.3 (2052.0) MB, 184.7 / 0.0 ms  (+ 402.5 ms in 80 steps since start of marking, biggest step 10.8 ms, walltime since start of marking 621 ms) (average mu = 0.091, current mu = 0.056) allocat

<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x13c5b79]
Security context: 0x333dc60008d1 <JSObject>
    1: /* anonymous */(aka /* anonymous */) [0x272cc807f611] [**REDACTED_PATH**cactus-origin/node_modules/webpack-sources/lib/applySourceMap.js:~74] [pc=0x321fda39a2a4](this=0x1abf413404b1 <undefined>,0x335a0f069239 <String[2]: a,>,0x248b1729e769 <Object map = 0x397f6ec7419>)
    2: SourceNode_walk [0x1ba3cd3e8699] [**REDACTED_PATH**cactus-origin/...


lerna ERR! npm run webpack:prod:node stderr:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20210402.115359.41474.0.001.json
Node.js report completed
 1: 0xa09830 node::Abort() [node]
 2: 0xa09c55 node::OnFatalError(char const*, char const*) [node]
 3: 0xb7d71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb7da99 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd2a1f5  [node]
 6: 0xd2a886 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xd37105 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xd37fb5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xd3aa6c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xd0163b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x104300e v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x13c5b79  [node]
Aborted (core dumped)
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! @hyperledger/cactus-example-supply-chain-backend@0.4.1 webpack:prod:node: `webpack --env=prod --target=node --config ../../webpack.config.js`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the @hyperledger/cactus-example-supply-chain-backend@0.4.1 webpack:prod:node script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     **REDACTED_PATH**.npm/_logs/2021-04-02T18_53_59_594Z-debug.log

lerna ERR! npm run webpack:prod:node exited 134 in '@hyperledger/cactus-example-supply-chain-backend'
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! @hyperledger/cactus@ webpack:prod:node: `lerna run webpack:prod:node`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the @hyperledger/cactus@ webpack:prod:node script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     **REDACTED_PATH**.npm/_logs/2021-04-02T18_53_59_611Z-debug.log
ERROR: "webpack:prod:node" exited with 134.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @hyperledger/cactus@ build:prod:backend: `npm-run-all webpack:prod:node`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @hyperledger/cactus@ build:prod:backend script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     **REDACTED_PATH**.npm/_logs/2021-04-02T18_53_59_623Z-debug.log
ERROR: "build:prod:backend" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @hyperledger/cactus@ build:prod: `npm-run-all build:prod:backend webpack:prod:web build:prod:frontend`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @hyperledger/cactus@ build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Screenshots

N/A

Cloud provider or hardware configuration:
Are you running the software on a dev machine or somewhere in the cloud?

Operating system name, version, build:

All of them.

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

main @ 0.4.1

Hyperledger Cactus Plugins/Connectors Used

N/A

Additional context

Came up during the issuance of the 0.4.1
The CI script fixes this for now by exporting the node options env var with additional RAM specified in there.

cc: @takeutak @sfuji822 @hartm @jonathan-m-hamilton @AzaharaC @jordigiam @kikoncuo @jagpreetsinghsasan

@petermetz petermetz added bug Something isn't working dependencies Pull requests that update a dependency file labels Apr 2, 2021
@petermetz petermetz self-assigned this Apr 2, 2021
petermetz added a commit to petermetz/cacti that referenced this issue Apr 14, 2021
…i#766

Increase the RAM to 4 GB for the webpack bundling process
so that it has enough to work with instead
of crashing.

Fixes hyperledger-cacti#766

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit that referenced this issue Apr 16, 2021
Increase the RAM to 4 GB for the webpack bundling process
so that it has enough to work with instead
of crashing.

Fixes #766

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant