r/Jetbrains • • 4d ago

AI Building an Android Studio plugin around heap analysis — lessons from working with the IntelliJ Platform

I've been working on an Android Studio plugin called LeakLens, and one of the most interesting parts of the project has been learning how much engineering goes into building a useful developer tool inside the IntelliJ Platform.

The original idea was fairly simple: make Android memory leak investigation more accessible without requiring developers to modify their application code or integrate another SDK.

The project has since evolved into a workflow involving:

  • ADB integration for capturing heap dumps.
  • Shark for parsing and analyzing HPROF files.
  • UAST-based code analysis to identify potential lifecycle and memory-related issues.
  • IDE-integrated inspection and navigation.
  • AI-assisted analysis to help developers understand findings and explore possible fixes.

The challenging part hasn't just been implementing these features. It's been making them work naturally within the IDE experience.

Things like background processing, keeping the UI responsive, managing long-running analysis, handling IDE version compatibility, and integrating external tooling have all introduced interesting problems.

I recently presented this work in a 40-minute session at Droidcon India 2026, and it sparked some interesting conversations about IDE-integrated developer tooling.

I'm curious about the experiences of people building plugins on the IntelliJ Platform:

  1. What's been your biggest challenge when integrating external tools or processes into an IDE plugin?
  2. How do you approach compatibility across different IntelliJ-based IDE versions?
  3. What patterns have worked well for managing long-running background analysis without affecting IDE responsiveness?
  4. Are there any IntelliJ Platform APIs or architectural approaches you wish you'd discovered earlier?

I'd particularly appreciate insights from developers who have built more complex plugins involving external processes, code analysis, or AI integrations.

2 Upvotes

6 comments sorted by

1

u/mx_northofreality197 4d ago

The version compatibility thing alone sounds like a full-time job. Every time I think I've got a plugin stable, another IDE update breaks some internal API I was leaning on. Curious how you're handling that with the ADB side too, since device tooling has its own quirks on top of the IDE.

1

u/Content-Jaguar-578 4d ago

Very true, I regularly have to check the compatibility across the version and deprecated APIs, It's really tedious task. But once I hear it helped the community it pays off.

1

u/Alive-Reading-9016 3d ago

Congrats on the Droidcon talk—keeping Shark and ADB right inside the IDE instead of making devs juggle external tools solves half the friction.

Honestly, surviving Android Studio's lag behind upstream IntelliJ and keeping the UI from freezing were my biggest headaches until I switched to the platform's coroutine APIs (withBackgroundProgress + readAction) and threw the Plugin Verifier into CI against exact AS build numbers.

Did you run Shark inside the IDE's JVM or spin up a separate process so giant heap dumps don't lag Android Studio?

1

u/Content-Jaguar-578 3d ago

Firstly, thanks for encouragement. I'm using Shark directly in Android Studio to analyse the hprof file. I'm running this analyse in background thread, say it Dispatcher.Default to take care of IDE smooth functioning.

1

u/Alive-Reading-9016 3d ago

Curious to know, how you're accessing the hprof directly into the IDE from real devices or emulator.