Memory leak happened on bruno-cli version 2.2.2
I have checked the following:
- [x] I have searched existing issues and found nothing related to my issue.
This bug is:
- [ ] making Bruno unusable for me
- [x] slowing me down but I'm able to continue working
- [x] annoying
- [x] this feature was working in a previous version but is broken in the current release.
Bruno version
1.38.1
Operating System
CentOs7
Describe the bug
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
.bru file to reproduce the bug
No response
Screenshots/Live demo link
[192:0x12dbc1c0] 108315 ms: Mark-Compact (reduce) 499.4 (510.0) -> 499.3 (508.0) MB, 763.05 / 0.00 ms (+ 24.0 ms in 3 steps since start of marking, biggest step 13.4 ms, walltime since start of marking 790 ms) (average mu = 0.322, current mu = 0.332) f[192:0x12dbc1c0] 109828 ms: Mark-Compact 500.3 (508.0) -> 500.3 (512.0) MB, 1512.32 / 0.00 ms (average mu = 0.141, current mu = 0.001) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
@WilliamSkyWalker Could you provide a bit more information on this? Is the issue still occurring in v2.2.0? It would be helpful to know which command triggered it. If possible, please share a sample collection or the files and data involved—feel free to remove any sensitive information.
@anusree-bruno Sorry it's not possible to seperate sensitive information from my test case. I can only tell the problem happened when generatiing html or json test report. Please add some crash log in bruno cli when bad thing happened, and let people decide whether share to the developer or not. And other people meet this problem might want to add comments on this issue. Best wishes.
@WilliamSkyWalker Can you share the args that were used when running the CLI ?
For instance does your run use --reporter-html arg?
Hi everybody,
I confirm the issue in v2.2.0. See below the bru file I'm trying to use.
In v2.1.0, it's better
`meta { name: Post Kit File type: http seq: 57 }
post { url: {{baseUrl}}:{{port}}/{{api}}/kit/file/{{id}} body: none auth: inherit }
vars:pre-request { id: 000myidrandominhex000 }
script:pre-request { const fs = require("fs"); const path = require("path"); const FormData = require("form-data");
const cwd = bru.cwd(); const url = bru.getEnvVar("host") + "/api/v1/kit/file"; const attachmentFilename = "my_file.pdf"; const attachmentPath = path.join(cwd,'../public/files/kits/myfile.pdf'); const attachment = fs.readFileSync(attachmentPath);
const formData = new FormData(); formData.append('file', attachment, { filename: attachmentFilename });
req.setBody(formData); } `
@lohit-bruno Can you take a look at this ?
Hi @damieng57, Thanks for sharing the .bru file.
I tested it on my end (after updating the URL), but I wasn’t able to reproduce the issue.
These are the args that I used bru run --reporter-json results.json --reporter-junit results.xml --reporter-html results.html
To help us investigate further, could you please clarify the following:
- Are you using any authentication at the collection or folder level?
- What is the size of the PDF file you're working with? If possible, try testing with a smaller file to see if the issue persists.
- Does the issue occur even when you run just the individual request?
- Do you have any collection/folder level scripts?