Understanding Java Memory Leaks
This post delves into Java memory management, common types of OutOfMemoryError, and demonstrates how to create various memory leaks like byte, list, map key, and class leaks with practical examples.
Topic
36 articles tagged “java”.
This post delves into Java memory management, common types of OutOfMemoryError, and demonstrates how to create various memory leaks like byte, list, map key, and class leaks with practical examples.
An overview of the Java 8 Stream API, covering its definition, core characteristics like pipelining and internal iteration, and the distinction between intermediate and terminal operations, alongside its benefits for collection processing.
An introduction to Java profiling, covering common performance issues and essential built-in JDK tools like jmap, jstack, jconsole, and VisualVM, along with mentions of specialized profilers.
This post explores refactoring complex conditional statements (like switch or if-else ladders) into a more maintainable and object-oriented polymorphic design, demonstrating how it enhances code readability and extensibility.
An in-depth look at how Java implements generics through type erasure, including the steps involved, its compile-time nature, and the role of synthetic bridge methods in preserving polymorphism, illustrated with code examples.
A guide to implementing a basic remote logger for Android applications, allowing logs to be sent from the device to a backend server for centralized monitoring.
Learn how to store and access your Android application context globally using a static field in your custom Application class, reducing the need to pass it around.
Learn how to integrate Google Analytics into your Android application more cleanly using ActivityLifecycleCallbacks instead of manual onStart and onStop calls in every Activity.
Explore a custom implementation of a blocking queue in Java, complete with worker threads and the 'poison pill' termination technique. This article demonstrates fundamental concurrency concepts and serves as a learning exercise compared to using Java's built-in `BlockingQueue`.
A guide on how to pass array instances directly to methods in Java, and a technique using anonymous inner classes with instance initialization for collections.
Explore two common methods for creating new threads in Java: implementing the Runnable interface or extending the Thread class and overriding its run() method.
Explore the Builder Pattern as an elegant solution for handling a large number of optional parameters in constructors, addressing limitations of telescopic constructors and JavaBeans.
An explanation of the Visitor design pattern, demonstrating how to define new operations on objects without modifying their classes, using a Java example with vehicle fuel efficiency calculations.
An explanation of Google App Engine's push technology using long polling, detailing client-server communication channels, an example application, and code snippets for client-side JavaScript and server-side Java implementation.
Explore the concept of ThreadLocal in Java, its unique scope, global access within a thread, and common use cases in web applications and as an alternative to object pools.
An overview of different reference types in Java, including strong, weak, and soft references, explaining their behavior with the garbage collector and common use cases like caching.
An introduction to the Command pattern, including its definition, use cases, and an example demonstrating complete decoupling between sender and receiver.
A quick guide on how to use the ROME library in Java to easily fetch and parse RSS feeds, including a practical code example.
Exploring various concurrent programming strategies in Java, including single-threaded, simple multi-threaded, thread pooling, and the Future and Callable mechanisms, along with a performance comparison.
This post explores key differences between Groovy and Java, focusing on Groovy's closures and its dynamic programming capabilities, with practical code examples.
An introduction to the Groovy programming language, covering its core concepts, fundamental differences from Java, productivity features, operators, data types, collections, and regular expression support.
Learn how to pass structured data, including multiple rows and columns, from Java to Oracle PL/SQL stored procedures using Oracle-specific ARRAY and STRUCT objects.
An explanation of the Decorator design pattern in Java, including its definition, implementation examples, and a demonstration of how it adds functionality to objects dynamically.
A tutorial on developing a 2D Android game similar to Hexxagon, covering game rules, class design, UI, and animation using Java 2D interfaces.
A guide to using XPath for XML document parsing and querying in Java, with practical code examples.
A simple and descriptive example of performing Saxon XSLT transformations using Java, including a code snippet and setup instructions.
An in-depth look at the Model-View-Controller (MVC) architectural pattern, its core components, application in web development, particularly with JSP and Servlets, and a discussion on related frameworks.
This post explains how to convert Java Collections to typed arrays using the Collection.toArray(T[] a) method, avoiding explicit casting.
Learn how to track and monitor SQL queries executed by View Objects in ADF applications by overriding the executeQueryForCollection method and extracting parameter values.
An introduction to creational design patterns, focusing on the Factory Method and Abstract Factory patterns, with Java examples and a comparison of their usage.
An introduction to the core concepts of the Spring framework, focusing on how to wire and instantiate Java POJO (Plain Old Java Object) beans using XML configuration, demonstrated with a practical Employee-Department system example.
This post describes how to dynamically modify the SQL WHERE clause in an ADF View Object by overriding the `buildWhereClause` method, which is particularly useful for optimizing queries without creating new database indexes.
This post demonstrates how to create a custom read-only view object in Oracle ADF JDeveloper, leveraging an Oracle REF CURSOR as an alternative data source. It covers initial JDeveloper setup, database package creation, and customizing the View Object implementation class.
An introduction to the Template Method design pattern in Java, illustrating its use for controlling algorithm flow with abstract superclasses and concrete subclasses, including an example for JSON and XML object creation.
An introduction to the Template Method design pattern in Java, illustrating its use for controlling algorithm flow with abstract superclasses and concrete subclasses, including an example for JSON and XML object creation.
A comparison of the Strategy pattern with the Template Method pattern in Java, showing differences and providing a code example.