Can using Valgrind on Linux also help when the application is compiled on Solaris?

I wrote a C application designed to run on a Solaris SPARC system. However, most of my development was on my 64-bit Mint Linux machine.

I saw that I had a small memory leak, and I used Valgrind for Linux to check this.

My question is: if I ran Valgrind on Linux and did all 100% memory leaks (or at least close to that), if I can compile the application on Solaris, then it should also behave the same (which I don't need to use special tools for detecting Solaris memory leaks?)

The reason I'm asking for is that I don’t have time to study all these profiling tools for each platform ..... I hope that if Valgrind tells me to fix something, that the fix will also work on Solaris?

I know that memory management between Linux and Solaris would be completely different, but, of course, if they detected a memory leak, would they be the same?

Any advice / help is appreciated; -)

Linton

+3
source share
1 answer

Generally speaking, if the code execution path on both systems is the same and you clear memory leaks on one, then yes, it clears them on the other system as well.

This is not so straightforward when there are still different things between the machines. EG, he is trying to do something on the linux system and something else on the Solaris system.

Valgrind - , linux , ( ps , Solaris , " t).

+3

Source: https://habr.com/ru/post/1788768/


All Articles