# Vadzimv Dev

Blog of a curious developer.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## OutOfMemoryError on Android: heap dump recording

DevFeed: [OutOfMemoryError on Android: heap dump recording](<https://devfeed.tech/articles/outofmemoryerror-on-android-heap-dump-recording-26142.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2024/01/07/oom-android-heap-dump-recording.html>)

Author: Vadzimv Dev Blog

Published: 2024-01-07T11:00:00Z

Content type: tutorial

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [heap](<https://devfeed.tech/tags/heap.md>), [java](<https://devfeed.tech/tags/java.md>)

### AI overview

An Android heap dump captured when an OutOfMemoryError occurs can reveal which objects occupy memory and what prevents garbage collection, whereas the error's stack trace points only to the final failed allocation. The excerpt describes automating capture with an UncaughtExceptionHandler and dumpHprofData, since manually recording at the right moment is impractical. Initialize the handler once, for example in Application#onCreate, and account for libraries such as Firebase Crashlytics that may replace the default handler. Dumps are saved in internal app storage; the excerpt says to download them with Android Studio's Device Explorer and convert them from Android to Java format using Android SDK platform tools. It does not include the full implementation details.

### Source excerpt

Learn how to record a Java heap dump at the moment of OutOfMemoryError.

## Notes from the "Pragmatic Programmer" book

DevFeed: [Notes from the "Pragmatic Programmer" book](<https://devfeed.tech/articles/notes-from-the-pragmatic-programmer-book-26141.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2023/05/21/pragmatic-programmer-book.html>)

Author: Vadzimv Dev Blog

Published: 2023-05-21T07:30:00Z

Content type: article

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Tutorial](<https://devfeed.tech/topics/tutorial.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Self-organizing Team](<https://devfeed.tech/topics/self-organizing-team.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [advice](<https://devfeed.tech/tags/advice.md>), [balance](<https://devfeed.tech/tags/balance.md>), [book](<https://devfeed.tech/tags/book.md>), [business](<https://devfeed.tech/tags/business.md>), [code](<https://devfeed.tech/tags/code.md>), [customer](<https://devfeed.tech/tags/customer.md>), [energy](<https://devfeed.tech/tags/energy.md>), [experience](<https://devfeed.tech/tags/experience.md>), [financial](<https://devfeed.tech/tags/financial.md>), [focus](<https://devfeed.tech/tags/focus.md>), [frameworks](<https://devfeed.tech/tags/frameworks.md>), [goals](<https://devfeed.tech/tags/goals.md>), [knowledge](<https://devfeed.tech/tags/knowledge.md>), [learn](<https://devfeed.tech/tags/learn.md>), [means](<https://devfeed.tech/tags/means.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [mind](<https://devfeed.tech/tags/mind.md>), [name](<https://devfeed.tech/tags/name.md>), [notes](<https://devfeed.tech/tags/notes.md>), [problems](<https://devfeed.tech/tags/problems.md>)

### AI overview

The notes argue that pragmatic programming starts with solving users' business problems, not treating software delivery or engineering metrics as ends in themselves. Clarify how the customer will judge success, check whether requirements serve that goal, and focus the team on it; completed sprint tasks and high test coverage do not by themselves show that users' problems are solved. The author also recommends trying tools only when they help achieve goals, understanding teammates' viewpoints without making disagreement personal, and continually learning because software knowledge becomes outdated. The excerpt begins a financial-portfolio analogy for choosing what to learn, listing regular investment, diversification, and a balance between lower- and higher-risk choices, but it cuts off before completing the advice.

### Source excerpt

Notes from the "Pragmatic Programmer" book

## Detect small memory leaks

DevFeed: [Detect small memory leaks](<https://devfeed.tech/articles/detect-small-memory-leaks-26140.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2022/10/10/detect-small-memory-leaks.html>)

Author: Vadzimv Dev Blog

Published: 2022-10-10T08:20:00Z

Content type: tutorial

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [Monitoring](<https://devfeed.tech/topics/monitoring.md>), [memory handling](<https://devfeed.tech/topics/memory-handling.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [batch](<https://devfeed.tech/tags/batch.md>), [mapbox](<https://devfeed.tech/tags/mapbox.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>), [oom](<https://devfeed.tech/tags/oom.md>), [perfetto](<https://devfeed.tech/tags/perfetto.md>), [queries](<https://devfeed.tech/tags/queries.md>), [recording](<https://devfeed.tech/tags/recording.md>), [rss](<https://devfeed.tech/tags/rss.md>), [sdk](<https://devfeed.tech/tags/sdk.md>)

### AI overview

For a foreground navigation app that may run for days or weeks, small leaks can accumulate toward an OOM, while ordinary app lifetimes may hide them. Android Studio's profiler became unresponsive during multi-hour recording, so the author uses Android's system trace recording (available since Android 9), increasing trace size and duration, capturing only memory-related activity, and splitting recordings into files if needed. In Perfetto Trace Viewer, the process RSS chart is hard to interpret because usage fluctuates. The author built a Perfetto trace analyzer to query RSS over time and describes using the batch processor to process multiple roughly 12-hour traces in parallel; the excerpt ends before showing the query or analysis results.

### Source excerpt

Detect small memory leaks in Android applications.

## Slow unit tests: objects mocking

DevFeed: [Slow unit tests: objects mocking](<https://devfeed.tech/articles/slow-unit-tests-objects-mocking-26139.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2022/06/03/slow-unit-tests-part-1-objects-mocking.html>)

Author: Vadzimv Dev Blog

Published: 2022-06-03T09:00:00Z

Content type: article

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Mocking](<https://devfeed.tech/topics/mocking.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [junit](<https://devfeed.tech/tags/junit.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

This article measures factors that affect unit-test execution time, focusing on object mocking. It compares a baseline with real objects, manually written test doubles, and mocking libraries such as Mockito and Mockk. In the reported measurements, Mockito significantly increased execution time when creating the first mock, while repeated mocks and behavior verification had little additional cost.

### Source excerpt

What does make unit tests slow? Is it objects mocking?

## Notes from the "Test Driven Development by example" book

DevFeed: [Notes from the "Test Driven Development by example" book](<https://devfeed.tech/articles/notes-from-the-test-driven-development-by-example-book-26138.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2022/04/07/notes-from-tdd-by-example.html>)

Author: Vadzimv Dev Blog

Published: 2022-04-07T10:00:00Z

Content type: article

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [amazon](<https://devfeed.tech/tags/amazon.md>), [automated](<https://devfeed.tech/tags/automated.md>), [book](<https://devfeed.tech/tags/book.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [development](<https://devfeed.tech/tags/development.md>), [e2e](<https://devfeed.tech/tags/e2e.md>), [errors](<https://devfeed.tech/tags/errors.md>), [fail](<https://devfeed.tech/tags/fail.md>), [fast](<https://devfeed.tech/tags/fast.md>), [faster](<https://devfeed.tech/tags/faster.md>), [feedback](<https://devfeed.tech/tags/feedback.md>), [fewer](<https://devfeed.tech/tags/fewer.md>), [generic](<https://devfeed.tech/tags/generic.md>), [green](<https://devfeed.tech/tags/green.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implement](<https://devfeed.tech/tags/implement.md>), [independent](<https://devfeed.tech/tags/independent.md>), [notes](<https://devfeed.tech/tags/notes.md>), [reading](<https://devfeed.tech/tags/reading.md>), [test-driven-development](<https://devfeed.tech/tags/test-driven-development.md>)

### AI overview

The notes present TDD as a way to counter a cycle in which stress reduces testing and errors increase stress: writing and running automated tests can provide quicker feedback and help reduce errors. They describe a cycle of testing one usage scenario, confirming failure, hardcoding a passing result, then refactoring toward a more general solution; triangulation adds a second scenario before generalizing. The author also recommends running a new test even when failure is expected, since this checks that the test itself works. TDD-generated tests do not replace usability, exploratory, or other testing; the notes suggest stable code can leave professional testers time for those activities. Coverage can improve either by adding tests or by simplifying logic to reduce possible cases. Since whole-application end-to-end tests may be too slow, the excerpt favors testing smaller, isolated modules and composing them into loosely coupled, cohesive pieces.

### Source excerpt

My notes after reading the Test Driven Development: By Example book

## Android Native Text

DevFeed: [Android Native Text](<https://devfeed.tech/articles/android-native-text-26137.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2021/10/01/android-native-text.html>)

Author: Vadzimv Dev Blog

Published: 2021-10-01T09:00:00Z

Content type: tutorial

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Localization (l10n)](<https://devfeed.tech/topics/localization.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [locale](<https://devfeed.tech/tags/locale.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

### AI overview

This tutorial explains how to handle Android string and plural resources in view models while avoiding stale text after configuration or language changes. It recommends storing resource IDs and arguments in view models, resolving localized text in the UI, and unit-testing the resulting parameters without directly interacting with the Android framework.

### Source excerpt

How to use Android String and Plurals resources in a View Model + Unit testing them.

## Rules of painless unit tests

DevFeed: [Rules of painless unit tests](<https://devfeed.tech/articles/rules-of-painless-unit-tests-26136.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2021/09/30/painless-unit-tests.html>)

Author: Vadzimv Dev Blog

Published: 2021-09-30T07:00:00Z

Content type: article

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Software Testing](<https://devfeed.tech/topics/software-testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [code](<https://devfeed.tech/tags/code.md>), [communication](<https://devfeed.tech/tags/communication.md>), [complex](<https://devfeed.tech/tags/complex.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [details](<https://devfeed.tech/tags/details.md>), [email](<https://devfeed.tech/tags/email.md>), [external](<https://devfeed.tech/tags/external.md>), [factory](<https://devfeed.tech/tags/factory.md>), [fake](<https://devfeed.tech/tags/fake.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [network](<https://devfeed.tech/tags/network.md>), [random](<https://devfeed.tech/tags/random.md>), [red](<https://devfeed.tech/tags/red.md>), [rules](<https://devfeed.tech/tags/rules.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>), [useful](<https://devfeed.tech/tags/useful.md>)

### AI overview

The author's core takeaway is to make unit tests specific to observable behavior so refactoring does not break tests when functionality still works. Use the SUT's public API as clients do, hardcode expected results, and keep test logic simple. Isolate tests from networks, filesystems, time, randomness, concurrency, sleeps, and delays with fakes, stubs, or mocks. Use fakes or stubs to provide dependency results; reserve mocks for verifying important external interactions. Check only behavior that matters, since internal calls and unrelated fields can change without affecting the feature. The excerpt also begins a rule favoring factory methods over constructors for test objects, especially DTOs, but cuts off before explaining how.

### Source excerpt

Rules that make unit tests useful.

## Notes from the Clean Architecture book

DevFeed: [Notes from the Clean Architecture book](<https://devfeed.tech/articles/notes-from-the-clean-architecture-book-26135.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2021/09/28/notes-from-clean-architecture-book.html>)

Author: Vadzimv Dev Blog

Published: 2021-09-28T09:30:00Z

Content type: article

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [clean-architecture](<https://devfeed.tech/topics/clean-architecture.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [architecture-components](<https://devfeed.tech/topics/architecture-components.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [book](<https://devfeed.tech/tags/book.md>), [clean-architecture](<https://devfeed.tech/tags/clean-architecture.md>), [components](<https://devfeed.tech/tags/components.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [diagram](<https://devfeed.tech/tags/diagram.md>), [notes](<https://devfeed.tech/tags/notes.md>), [principles](<https://devfeed.tech/tags/principles.md>), [release](<https://devfeed.tech/tags/release.md>), [tradeoffs](<https://devfeed.tech/tags/tradeoffs.md>)

### AI overview

The notes describe tradeoffs among three component cohesion principles: REP groups reusable classes so they can be released together; CCP groups classes that change for the same reason, which can simplify maintenance; CRP groups classes reused together and discourages including classes clients do not use. Organizing around CCP may reduce the number of components affected by a feature, but can cause extra releases and rebuilds, retests, and redeployments after dependency changes. To address the "morning after syndrome" of unstable shared builds, the Acyclic Dependencies Principle approach splits a project into releasable components with owners. Teams can version and integrate dependencies independently: downstream teams adopt a new component version when ready, rather than all updating at once. These are selected notes, not a short version of the book.

### Source excerpt

New things that I found in the Clean Architecture book.

## Pick lint version

DevFeed: [Pick lint version](<https://devfeed.tech/articles/pick-lint-version-26134.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2021/07/28/calculate-lint-version.html>)

Author: Vadzimv Dev Blog

Published: 2021-07-28T15:00:00Z

Content type: tutorial

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [lint](<https://devfeed.tech/topics/lint.md>), [version](<https://devfeed.tech/topics/version.md>), [Android Gradle Plugin](<https://devfeed.tech/topics/android-gradle-plugin.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Dependency management](<https://devfeed.tech/topics/dependency-management.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-gradle-plugin](<https://devfeed.tech/tags/android-gradle-plugin.md>), [automate](<https://devfeed.tech/tags/automate.md>), [automation](<https://devfeed.tech/tags/automation.md>), [code](<https://devfeed.tech/tags/code.md>), [custom](<https://devfeed.tech/tags/custom.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [google](<https://devfeed.tech/tags/google.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [lint](<https://devfeed.tech/tags/lint.md>), [project](<https://devfeed.tech/tags/project.md>), [properties](<https://devfeed.tech/tags/properties.md>), [version](<https://devfeed.tech/tags/version.md>)

### AI overview

For a custom Android lint rule, the excerpt says the lint dependency version must match the Android Gradle Plugin (AGP) version using the stated convention: add 23 to AGP's major version while keeping the remaining version parts (for example, AGP 4.2.2 gives lint 27.2.2). To avoid recalculating manually after AGP updates, it proposes storing the AGP version in the root project's `ext` properties, parsing it in the lint project, adding 23 to the major version, and using the calculated value in dependencies. The excerpt does not show the code or explain compatibility beyond this convention.

### Source excerpt

How to pick lint dependency version when you implement a custom lint rule for Android project.

## Navigate without crashes using Android Jetpack Navigation

DevFeed: [Navigate without crashes using Android Jetpack Navigation](<https://devfeed.tech/articles/navigate-without-crashes-using-android-jetpack-navigation-26133.md>)

Original publisher: [Read original article](<https://vadzimv.dev/2021/07/26/android-jetpack-navigation-navigate-safe.html>)

Author: Vadzimv Dev Blog

Published: 2021-07-26T16:00:00Z

Content type: tutorial

Language: en

Sources: [Vadzimv Dev](<https://devfeed.tech/sources/vadzimv-dev-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Jetpack](<https://devfeed.tech/topics/jetpack.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [App](<https://devfeed.tech/topics/app.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-jetpack](<https://devfeed.tech/tags/android-jetpack.md>), [app](<https://devfeed.tech/tags/app.md>), [crash](<https://devfeed.tech/tags/crash.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception](<https://devfeed.tech/tags/exception.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-navigation](<https://devfeed.tech/tags/jetpack-navigation.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This tutorial explains how to use Android Jetpack Navigation safely in production. It recommends wrapper functions that handle navigation exceptions, log failures without treating them as crash reports, and use navigation actions to prevent duplicate navigation from simultaneous clicks.

### Source excerpt

Do not crash an app during navigation. Navigate safely.