Skip to content

Fix out of memory issue caused by iterative calls#518

Merged
ChinthakaJ98 merged 1 commit intowso2:mi-ext-alpha-releasefrom
ChinthakaJ98:iterate-memory-issue
Apr 8, 2026
Merged

Fix out of memory issue caused by iterative calls#518
ChinthakaJ98 merged 1 commit intowso2:mi-ext-alpha-releasefrom
ChinthakaJ98:iterate-memory-issue

Conversation

@ChinthakaJ98
Copy link
Copy Markdown
Contributor

This PR will fix the issue wso2/mi-vscode#1416

@ChinthakaJ98 ChinthakaJ98 requested a review from rosensilva as a code owner April 8, 2026 08:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1ecf871-e354-4c5a-840c-9b1f4311c2f2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines 34 to 39

public void addDependency(String path, Dependency dependency) {

if (path != null && dependency != null) {
dependencyMap.put(path, dependency);
cachedDependencyMap.put(path, dependency);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 1

Suggested change
public void addDependency(String path, Dependency dependency) {
if (path != null && dependency != null) {
dependencyMap.put(path, dependency);
cachedDependencyMap.put(path, dependency);
}
public void addDependency(String path, Dependency dependency) {
if (path != null && dependency != null) {
cachedDependencyMap.put(path, dependency);
log.debug("Added dependency for path: {}", path);
}

Comment on lines +47 to +52
public void addToVisitedPaths(String path) {

if (path != null) {
visitedPathSet.add(path);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 2

Suggested change
public void addToVisitedPaths(String path) {
if (path != null) {
visitedPathSet.add(path);
}
}
public void addToVisitedPaths(String path) {
if (path != null) {
visitedPathSet.add(path);
log.debug("Path marked as visited: {}", path);
}

@@ -52,8 +52,12 @@ public class DependencyVisitorUtils {
public static Dependency visitSequence(String projectPath, String sequenceName, DependencyLookUp dependencyLookUp) {

String inSequencePath = DependencyVisitorUtils.getDependencyPath(sequenceName, "sequences", projectPath);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 3

Suggested change
String inSequencePath = DependencyVisitorUtils.getDependencyPath(sequenceName, "sequences", projectPath);
String inSequencePath = DependencyVisitorUtils.getDependencyPath(sequenceName, "sequences", projectPath);
log.debug("Looking up dependency path for sequence: {}", sequenceName);

Comment on lines +55 to +56
if (dependencyLookUp.isVisited(inSequencePath)) {
return null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 4

Suggested change
if (dependencyLookUp.isVisited(inSequencePath)) {
return null;
if (dependencyLookUp.isVisited(inSequencePath)) {
log.debug("Sequence already visited: {}", inSequencePath);
return null;

Comment on lines 468 to 476
protected void visitFilter(Filter node) {

addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence());
addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence());
if (node.getThen() != null) {
addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence());
}
if (node.getElse_() != null) {
addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence());
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 5

Suggested change
protected void visitFilter(Filter node) {
addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence());
addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence());
if (node.getThen() != null) {
addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence());
}
if (node.getElse_() != null) {
addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence());
}
}
protected void visitFilter(Filter node) {
if (node.getThen() != null) {
log.debug("Processing 'then' branch of Filter mediator");
addAnonymousOrAttributeSequence(node.getThen().getMediatorList(), node.getThen().getSequence());
} else {
log.warn("Filter mediator has null 'then' branch");
}
if (node.getElse_() != null) {
log.debug("Processing 'else' branch of Filter mediator");
addAnonymousOrAttributeSequence(node.getElse_().getMediatorList(), node.getElse_().getSequence());
}

Copy link
Copy Markdown

@wso2-engineering wso2-engineering bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
  • Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.

✅ Before merging this pull request:

  • Review all AI-generated comments for accuracy and relevance.
  • Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
Comment Accepted (Y/N) Reason
#### Log Improvement Suggestion No: 1
#### Log Improvement Suggestion No: 2
#### Log Improvement Suggestion No: 3
#### Log Improvement Suggestion No: 4
#### Log Improvement Suggestion No: 5

@ChinthakaJ98 ChinthakaJ98 merged commit e6e2e2a into wso2:mi-ext-alpha-release Apr 8, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants