<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mamta Leel</title>
    <description>The latest articles on DEV Community by Mamta Leel (@mamta_leel).</description>
    <link>https://dev.to/mamta_leel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2252025%2F0c444bf1-00b4-4074-b02d-ba5d2d54c16e.png</url>
      <title>DEV Community: Mamta Leel</title>
      <link>https://dev.to/mamta_leel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mamta_leel"/>
    <language>en</language>
    <item>
      <title>Thread Internal Memory Allocation in Java | Thread vs Process</title>
      <dc:creator>Mamta Leel</dc:creator>
      <pubDate>Sat, 16 Aug 2025 12:03:25 +0000</pubDate>
      <link>https://dev.to/mamta_leel/thread-internal-memory-allocation-in-java-thread-vs-process-49nf</link>
      <guid>https://dev.to/mamta_leel/thread-internal-memory-allocation-in-java-thread-vs-process-49nf</guid>
      <description>&lt;p&gt;When learning multithreading in Java, it’s important to first understand how processes and threads work, and how the JVM allocates memory to manage them.&lt;/p&gt;

&lt;p&gt;🔹 &lt;strong&gt;Process vs Thread&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1wqqsqxw509i0xozknk4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1wqqsqxw509i0xozknk4.png" alt=" " width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Process&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A process is an instance of a program in execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each process has its own memory space (code, data, heap, stack).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Operating System (OS) allocates resources like CPU time, memory, and file handles to each process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: Running java Main starts the JVM as a process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thread&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A thread is the smallest unit of execution within a process (sometimes called a lightweight process).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A process can contain multiple threads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When a process starts, it begins with one main thread.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Threads inside a process run concurrently, improving performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each thread has its own stack, program counter, and name, but shares the process’s code, data, and heap.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧑‍💻 Example: Current Thread in Java&lt;/p&gt;

&lt;p&gt;&lt;code&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Running current thread: " + Thread.currentThread().getName());&lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Running current thread: main&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;👉 By default, the JVM starts your program with the main thread.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧩 JVM Instance &amp;amp; Memory Allocation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1am6hug0anmkc87qampe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1am6hug0anmkc87qampe.png" alt=" " width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you run a Java program, here’s what happens step by step:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Compilation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;javac Main.java&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Source code (.java) → Compiled into bytecode (.class)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bytecode is platform-independent, runs on the JVM.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Execution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;java Main&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;OS creates a process for the JVM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inside this process, a JVM instance is created.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JVM uses an interpreter/JIT compiler to convert bytecode → machine code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🗂 JVM Memory Segments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;_ Code Segment (Method Area)_&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Stores compiled bytecode/machine code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shared across all threads.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;_ Data Segment_&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Stores global and static variables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shared by all threads → needs synchronization.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;_ Heap Memory_&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Stores objects created with new.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shared across all threads.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Stack Memory (per thread)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Each thread has its own stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stores method calls, local variables, and references.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;_ Registers (per thread)_&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;CPU registers store the program counter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Used during context switching between threads.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;⚙️ Who Executes Threads?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The OS scheduler or JVM thread scheduler is responsible for:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Loading thread registers into the CPU.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Managing execution order.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Handling context switching.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensuring efficient parallel execution.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ Summary&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A process is a running program with its own memory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A thread is the smallest execution unit inside a process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JVM memory is divided into code, data, heap, stack, and registers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Threads share code, data, and heap, but each has its own stack and registers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This structure allows efficient execution and multithreading in Java.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🚀 With this foundation, you’re ready to dive deeper into Java concurrency APIs, thread pools, and synchronization techniques!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>DynamoDB Part-01- 🚀 Guide to Running DynamoDB Locally</title>
      <dc:creator>Mamta Leel</dc:creator>
      <pubDate>Mon, 03 Mar 2025 14:40:30 +0000</pubDate>
      <link>https://dev.to/mamta_leel/dynamodb-part-01-guide-to-running-dynamodb-locally-37b3</link>
      <guid>https://dev.to/mamta_leel/dynamodb-part-01-guide-to-running-dynamodb-locally-37b3</guid>
      <description>&lt;p&gt;Hey Dev Community! 👋&lt;br&gt;
To install dynamoDB locally follow the below steps. &lt;/p&gt;

&lt;p&gt;🛠️ Step 1: Download DynamoDB&lt;br&gt;
Get DynamoDB Local for free from the official sources:&lt;/p&gt;

&lt;p&gt;🖥️ Mac/Linux → Download &lt;a href="https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.tar.gz" rel="noopener noreferrer"&gt;tar.gz&lt;/a&gt;&lt;br&gt;
🖥️ Windows → Download &lt;a href="https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.zip" rel="noopener noreferrer"&gt;.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔧 Step 2: Install AWS CLI&lt;br&gt;
To easily view tables and data in a GUI, install the AWS CLI.&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#getting-started-install-instructions" rel="noopener noreferrer"&gt;here &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📂 Step 3: Extract and Run DynamoDB&lt;br&gt;
1️⃣ Extract the downloaded .zip file.&lt;br&gt;
2️⃣ Navigate to the directory containing DynamoDBLocal.jar.&lt;br&gt;
3️⃣ Run the following command:&lt;br&gt;
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb -dbPath C:/dynamodb/data&lt;/p&gt;

&lt;p&gt;💡 Important: Ensure that the dynamodb/data directory exists in the C:/ drive. If not, create it using:&lt;br&gt;
mkdir C:/dynamodb/data&lt;/p&gt;

&lt;p&gt;🔑 Step 4: Configure AWS Credentials for Local Use&lt;br&gt;
Set up AWS credentials for local development using:&lt;br&gt;
aws configure&lt;/p&gt;

&lt;p&gt;📋 Step 5: Verify Tables&lt;br&gt;
To check the available tables, run:&lt;br&gt;
aws dynamodb list-tables --endpoint-url &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎉 Your DynamoDB is running locally and now add a backend service and hit queries. or you can use terminal too to test it. &lt;br&gt;
Your DynamoDB is running port by default on 8000, you can change with    -port [port you want to keep]. and then check the data. &lt;/p&gt;

&lt;p&gt;In the next part, we’ll explore how to integrate DynamoDB with a Spring Boot application! 🚀&lt;/p&gt;

</description>
      <category>database</category>
      <category>aws</category>
      <category>dynamodb</category>
      <category>java</category>
    </item>
    <item>
      <title>Upgrading Your Application to Java 17: A Step-by-Step Guide for Developers</title>
      <dc:creator>Mamta Leel</dc:creator>
      <pubDate>Tue, 22 Oct 2024 14:27:17 +0000</pubDate>
      <link>https://dev.to/mamta_leel/upgrading-your-application-to-java-17-a-step-by-step-guide-for-developers-2l70</link>
      <guid>https://dev.to/mamta_leel/upgrading-your-application-to-java-17-a-step-by-step-guide-for-developers-2l70</guid>
      <description>&lt;p&gt;Hello, Developers!&lt;/p&gt;

&lt;p&gt;In this blog post, I’ll guide you through the process of updating your existing application to Java 17 (LTS). This upgrade can enhance your application's performance and security while providing access to the latest language features. Let’s dive into the steps!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Download a Compatible IDE&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, ensure you’re using an Integrated Development Environment (IDE) that supports Java 17 and above. For this guide, I recommend using IntelliJ IDEA version 2021.3.2 or later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Update Build Tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your project uses Maven or Gradle, update to a version compatible with Java 17. For instance, I used Maven version 3.9.9 during my upgrade process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Download JDK 17&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, download and install the Java Development Kit (JDK) 17 from the official Oracle website or your preferred distribution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Set Up Environment Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Update your environment variables to reflect the new Java installation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;JAVA_HOME&lt;/em&gt;: Set it to the path of your JDK 17 installation.&lt;br&gt;
&lt;em&gt;MAVEN_HOME&lt;/em&gt;: Update this to point to your latest Maven installation.&lt;br&gt;
If needed, set JAVA_17_HOME and M2_HOME to these respective paths.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Update cacerts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your application relies on the cacerts file located in jre/lib/security, ensure you copy the relevant cacerts file from your old JRE to the new JDK 17 directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Configure Your Project Settings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open your existing service in IntelliJ and check the project settings:&lt;/p&gt;

&lt;p&gt;Navigate to&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;File &amp;gt; Settings &amp;gt; Build, Execution, Deployment &amp;gt; Build Tools &amp;gt; Maven.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Enable Use Maven Wrapper to avoid dependency loading issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Update SDK and Language Level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to File &amp;gt; Project Structure and perform the following:&lt;/p&gt;

&lt;p&gt;Update the SDK to version 17.&lt;br&gt;
Set the project’s language level to 17 (this may include options like "17-Sealed Type,Always Strict,..").&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Build Your Application&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to clean and build your application:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mvn clean install -Djava_version=17&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9: Address Deprecated Dependencies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As you upgrade, some dependencies may be deprecated or relocated. Review your pom.xml and update any affected libraries. Below are some of the latest versions of common dependencies you might consider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;lombok.version&amp;gt;1.18.30&amp;lt;/lombok.version&amp;gt;
&amp;lt;httpclient.version&amp;gt;4.5.13&amp;lt;/httpclient.version&amp;gt;
&amp;lt;cucumber.version&amp;gt;7.18.0&amp;lt;/cucumber.version&amp;gt;
&amp;lt;spring-cloud.version&amp;gt;2021.0.6&amp;lt;/spring-cloud.version&amp;gt;
&amp;lt;jackson.version&amp;gt;2.17.2&amp;lt;/jackson.version&amp;gt;
&amp;lt;assertj-core.version&amp;gt;3.25.3&amp;lt;/assertj-core.version&amp;gt;
&amp;lt;rest-assured.version&amp;gt;5.4.0&amp;lt;/rest-assured.version&amp;gt;
&amp;lt;dom4j.version&amp;gt;2.4.3&amp;lt;/dom4j.version&amp;gt;
&amp;lt;jacoco-maven-plugin.version&amp;gt;0.8.8&amp;lt;/jacoco-maven-plugin.version&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to update your pom.xml dependencies to the latest compatible versions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10: Final Package Updates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lastly, check for any other packages that may need updating to ensure compatibility with Java 17. Some packages have been migrated to new packages. Here’s a list of those changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;javax.* → jakarta.*&lt;/li&gt;
&lt;li&gt;java.activation → jakarta.activation&lt;/li&gt;
&lt;li&gt;java.xml.ws.annotation → jakarta.annotation-api&lt;/li&gt;
&lt;li&gt;java.transaction → jakarta.transaction-api&lt;/li&gt;
&lt;li&gt;java.xml.bind → jakarta.xml.bind-api&lt;/li&gt;
&lt;li&gt;java.xml.ws → jakarta.xml.ws-api&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Upgrading to Java 17 can significantly improve your application's capabilities and maintainability. By following these steps, you’ll be well on your way to harnessing the full potential of the latest Java features.&lt;/p&gt;

&lt;p&gt;If you have any questions or need further assistance, feel free to leave a comment below!&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>java</category>
      <category>development</category>
      <category>beginners</category>
      <category>jakarta</category>
    </item>
  </channel>
</rss>
