# Decoding MAP file

**URL:** <https://community.particle.io/t/decoding-map-file/45066>\
**Category:** Troubleshooting\
**Created:** [November 8, 2018, 3:10am UTC](https://community.particle.io/t/decoding-map-file/45066 "2018-11-08T03:10:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suprazz](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Suprazz](https://community.particle.io/u/Suprazz)\
**Post date:** [November 8, 2018, 3:10am UTC](https://community.particle.io/t/decoding-map-file/45066/1 "2018-11-08T03:10:33Z")

</div>

So I have an application running on the photon but I’m about at the end of the user memory available.

The output with I build with api is

```nohighlight
Memory use:
text data bss dec hex	filename
128196 1224 18272 147692 240ec	/workspace/target/workspace.elf

```

I would like to understand what is using all the program memory so I compiled with Eclipse and GCC and now I have the .map file in the ouput folder of my application.

But I’m not sure what I’m looking at exactly. Any suggestions? I’m not sure how I can post the map file here.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [November 8, 2018, 11:05am UTC](https://community.particle.io/t/decoding-map-file/45066/2 "2018-11-08T11:05:13Z")

</div>

Since the biggest chunk of memory usage is `text` I’d suppose it’s the actual code.  
Most of it will be your own code and depending on what functions, features and libraries you use you’ll see extra demand due to on-demand linking of required modules.

Without seeing your code, there is little else we could say.

For a general understanding of the memory usage table you can look here

> **[text, data and bss: Code and Data Size Explained](https://mcuoneclipse.com/2013/04/14/text-data-and-bss-code-and-data-size-explained/)**
>
> In “Code Size Information with gcc for ARM/Kinetis” I use an option in the ARM gcc tool chain for Eclipse to show me the code size:    text       data        bss        dec        hex  …

---

<div class="post-metadata">

**Author:** ![Suprazz](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Suprazz](https://community.particle.io/u/Suprazz)\
**Post date:** [November 8, 2018, 1:49pm UTC](https://community.particle.io/t/decoding-map-file/45066/3 "2018-11-08T13:49:45Z")

</div>

yes this is the code. But I would like to know what part of the code is using all the memory.

I worked with Microchip PIC32 few years ago and the map file was much easier to understand.

What is all the debug\_xxx sections?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [November 8, 2018, 2:34pm UTC](https://community.particle.io/t/decoding-map-file/45066/4 "2018-11-08T14:34:49Z")

</div>

@Suprazz, I use this lovely .map file analyzer. It isn’t Particle specific but it will help you nonetheless.

[http://danieleff.com/stm32/map\_analizer/](http://danieleff.com/stm32/map_analizer/)

---

<div class="post-metadata">

**Author:** ![Suprazz](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Suprazz](https://community.particle.io/u/Suprazz)\
**Post date:** [November 8, 2018, 3:33pm UTC](https://community.particle.io/t/decoding-map-file/45066/5 "2018-11-08T15:33:09Z")

</div>

wow perfect! Thanks!
