Discussion:
[mitk-users] MitkWorkbench memory usage discrepancies
Jose Manuel Cuadra Troncoso
2017-05-15 18:42:31 UTC
Permalink
Hi,

I have observed discrepancies in memory usage reported by MitkWorkbench
on different operating systems. You can read memory usage at bottom
right corner of MitkWorkbench window.

When I just launch MitkWorkbench in Linux, using MITK-2016.03.0
compiled in release mode, an usage of about 1.80 GB is reported. In
Windows, using MITK-2016.03.0 compiled in release mode, 150 MB are
reported. In Mac, using MITK-2016.03.0 compiled in debug mode, 4.70 GB
are reported.
Apps for system monitoring report a MitkWorkbench memory usage of about
240 MB in Linux, 150 MB in Windows and 90 MB in Mac. Therefore, I think
that memory usage is well reported on Windows but it is incorrectly
reported on the other systems.

MitkWorkbench memory usage is reported using the function
GetProcessMemoryUsage() located at
Modules/Core/src/DataManagement/mitkMemoryUtilities.cpp.
In Windows it invokes GetProcessMemoryInfo( hProcess, &pmc,
sizeof(pmc)) and pmc.WorkingSetSize is used to read current working set
size. This is ok, see https://msdn.microsoft.com/es-es/library/windows/
desktop/ms684877(v=vs.85).aspx.
In Linux it reads /proc/self/statm file and it gets the first number
(named size in GetProcessMemoryUsage) in that file. That number
corresponds to total program size. I think the second number (named res
in GetProcessMemoryUsage) should be used instead, it is the resident
set size and it corresponds to the memory usage shown in monitoring
apps. See /proc/[pid]/statm in http://man7.org/linux/man-pages/man5/pro
c.5.html.
In Mac the virtual_size field of the task_basic_info structure is used.
I think the field resident_size should be used instead. See task_info()
in http://nadeausoftware.com/articles/2012/07/c_c_tip_how_get_process_
resident_set_size_physical_memory_use#taskinfoforcurrentresidentsetsize
.

Regards,
Jose Manuel
--
,.....................................,................................,
: Jose Manuel Cuadra Troncoso : Email: ***@dia.uned.es :
: Dpto. de Inteligencia Artificial : Tel: (+34) 91-398-7144 :
: Univ. Nac. de Educacion a Distancia : Fax: (+34) 91-398-9382 :
: Juan del Rosal, 16 - 3ª : :
: E-28040 Madrid SPAIN : http://www.ia.uned.es/~jmcuadra:
'.....................................:................................'
Dinkelacker, Stefan
2017-05-16 00:41:42 UTC
Permalink
Hi,

nice, thanks for the hints! Would you like to contribute via GitHub? - This way your name would appear in the MITK commit history. Otherwise we would create a task at phabricator.mitk.org and place it up for grabs.

Best,
Stefan
________________________________________
Von: Jose Manuel Cuadra Troncoso <***@dia.uned.es>
Gesendet: Montag, 15. Mai 2017 20:42
An: mitk-***@lists.sourceforge.net
Betreff: [mitk-users] MitkWorkbench memory usage discrepancies

Hi,

I have observed discrepancies in memory usage reported by MitkWorkbench
on different operating systems. You can read memory usage at bottom
right corner of MitkWorkbench window.

When I just launch MitkWorkbench in Linux, using MITK-2016.03.0
compiled in release mode, an usage of about 1.80 GB is reported. In
Windows, using MITK-2016.03.0 compiled in release mode, 150 MB are
reported. In Mac, using MITK-2016.03.0 compiled in debug mode, 4.70 GB
are reported.
Apps for system monitoring report a MitkWorkbench memory usage of about
240 MB in Linux, 150 MB in Windows and 90 MB in Mac. Therefore, I think
that memory usage is well reported on Windows but it is incorrectly
reported on the other systems.

MitkWorkbench memory usage is reported using the function
GetProcessMemoryUsage() located at
Modules/Core/src/DataManagement/mitkMemoryUtilities.cpp.
In Windows it invokes GetProcessMemoryInfo( hProcess, &pmc,
sizeof(pmc)) and pmc.WorkingSetSize is used to read current working set
size. This is ok, see https://msdn.microsoft.com/es-es/library/windows/
desktop/ms684877(v=vs.85).aspx.
In Linux it reads /proc/self/statm file and it gets the first number
(named size in GetProcessMemoryUsage) in that file. That number
corresponds to total program size. I think the second number (named res
in GetProcessMemoryUsage) should be used instead, it is the resident
set size and it corresponds to the memory usage shown in monitoring
apps. See /proc/[pid]/statm in http://man7.org/linux/man-pages/man5/pro
c.5.html.
In Mac the virtual_size field of the task_basic_info structure is used.
I think the field resident_size should be used instead. See task_info()
in http://nadeausoftware.com/articles/2012/07/c_c_tip_how_get_process_
resident_set_size_physical_memory_use#taskinfoforcurrentresidentsetsize
.

Regards,
Jose Manuel
--
,.....................................,................................,
: Jose Manuel Cuadra Troncoso : Email: ***@dia.uned.es :
: Dpto. de Inteligencia Artificial : Tel: (+34) 91-398-7144 :
: Univ. Nac. de Educacion a Distancia : Fax: (+34) 91-398-9382 :
: Juan del Rosal, 16 - 3ª : :
: E-28040 Madrid SPAIN : http://www.ia.uned.es/~jmcuadra:
'.....................................:................................'

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users
Dinkelacker, Stefan
2017-05-16 08:54:04 UTC
Permalink
Great! You can use the GitHub workflow for contributing. Just fork the MITK repository to your GitHub account (Fork button at the top right of our repo site on GitHub [1]), create a branch, make the changes there in a commit that you sign-off (there's a sign-off button in Git Gui, or see [2] if you are working in terminal) and push to your fork. Now click on "New Pull Request" on our repo site where you can select your branch at your repo and our master to compare (note the "compare across forks" link) [3].

We can then easily pull your changes and keep you as the committer.

Before you sign off your commit, make sure that you set your name and email address in git config with:

git config --global user.name "Your Name"
git config --global user.email ***@company.com

If you want to be even more involved, you are free to create an account in our issue tracker [4] and create a "Wishlist" priority task which you tag with "Pull Request". But that's optional. :-)

[1] https://github.com/MITK/MITK/
[2] https://git-scm.com/docs/git-commit#git-commit--s
[3] https://github.com/MITK/MITK/compare?expand=1
[4] https://phabricator.mitk.org/

-----Original Message-----
From: Jose Manuel Cuadra Troncoso [mailto:***@dia.uned.es]
Sent: Dienstag, 16. Mai 2017 10:37
To: Dinkelacker, Stefan
Subject: Re: AW: [mitk-users] MitkWorkbench memory usage discrepancies

Hi,

I would like to contribute via GitHub. I already wrote the changes and I have recompiled MITK, at least in Linux. What should I do to contribute?

Regards,
Jose Manuel
Post by Dinkelacker, Stefan
Hi,
nice, thanks for the hints! Would you like to contribute via GitHub?
- This way your name would appear in the MITK commit history.
Otherwise we would create a task at phabricator.mitk.org and place it
up for grabs.
Best,
Stefan
________________________________________
Gesendet: Montag, 15. Mai 2017 20:42
Betreff: [mitk-users] MitkWorkbench memory usage discrepancies
Hi,
I have observed discrepancies in memory usage reported by
MitkWorkbench on different operating systems. You can read memory
usage at bottom right corner of MitkWorkbench window.
When I just launch MitkWorkbench in Linux, using MITK-2016.03.0
compiled in release mode, an usage of about 1.80 GB is reported. In
Windows, using MITK-2016.03.0 compiled in release mode, 150 MB are
reported. In Mac, using MITK-2016.03.0 compiled in debug mode, 4.70 GB
are reported.
Apps for system monitoring report a MitkWorkbench memory usage of about
240 MB in Linux, 150 MB in Windows and 90 MB in Mac. Therefore, I
think that memory usage is well reported on Windows but it is
incorrectly reported on the other systems.
MitkWorkbench memory usage is reported using the function
GetProcessMemoryUsage() located at
Modules/Core/src/DataManagement/mitkMemoryUtilities.cpp.
In Windows it invokes GetProcessMemoryInfo( hProcess, &pmc,
sizeof(pmc)) and pmc.WorkingSetSize is used to read current working
set size. This is ok, see
https://msdn.microsoft.com/es-es/library/window
s/
desktop/ms684877(v=vs.85).aspx.
In Linux it reads /proc/self/statm file and it gets the first number
(named size in GetProcessMemoryUsage) in that file. That number
corresponds to total program size. I think the second number (named
res in GetProcessMemoryUsage) should be used instead, it is the
resident set size and it corresponds to the memory usage shown in
monitoring apps. See /proc/[pid]/statm in
http://man7.org/linux/man-pages/man5/p
ro
c.5.html.
In Mac the virtual_size field of the task_basic_info structure is used.
I think the field resident_size should be used instead. See
task_info()
 in http://nadeausoftware.com/articles/2012/07/c_c_tip_how_get_proces
s_
resident_set_size_physical_memory_use#taskinfoforcurrentresidentsetsi
ze
.
Regards,
Jose Manuel
--
,.....................................,..............................
..,
: Dpto. de Inteligencia Artificial    : Tel:  (+34) 91-398-
: Univ. Nac. de Educacion a Distancia : Fax:  (+34) 91-398-
: Juan del Rosal, 16 -
: E-28040 Madrid       SPAIN          : http://www.ia.uned.es/~jmcuad
'.....................................:..............................
..'
-------------------------------------------------------------------
-----------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
,.....................................,................................,
: Jose Manuel Cuadra Troncoso : Email: ***@dia.uned.es :
: Dpto. de Inteligencia Artificial : Tel: (+34) 91-398-7144 :
: Univ. Nac. de Educacion a Distancia : Fax: (+34) 91-398-9382 :
: Juan del Rosal, 16 - 3ª : :
: E-28040 Madrid SPAIN : http://www.ia.uned.es/~jmcuadra:
'.....................................:................................'
Jose Manuel Cuadra Troncoso
2017-05-16 08:39:57 UTC
Permalink
Hi,

I would like to contribute via GitHub. I already wrote the changes and
I have recompiled MITK, at least in Linux. What should I do to
contribute?

Regards,
Jose Manuel
Post by Dinkelacker, Stefan
Hi,
nice, thanks for the hints! Would you like to contribute via GitHub?
- This way your name would appear in the MITK commit history.
Otherwise we would create a task at phabricator.mitk.org and place it
up for grabs.
Best,
Stefan
________________________________________
Gesendet: Montag, 15. Mai 2017 20:42
Betreff: [mitk-users] MitkWorkbench memory usage discrepancies
Hi,
I have observed discrepancies in memory usage reported by
MitkWorkbench
on different operating systems. You can read memory usage at bottom
right corner of MitkWorkbench window.
When I just launch MitkWorkbench in Linux, using MITK-2016.03.0
compiled in release mode, an usage of about 1.80 GB is reported. In
Windows, using MITK-2016.03.0 compiled in release mode, 150 MB are
reported. In Mac, using MITK-2016.03.0 compiled in debug mode, 4.70 GB
are reported.
Apps for system monitoring report a MitkWorkbench memory usage of about
240 MB in Linux, 150 MB in Windows and 90 MB in Mac. Therefore, I think
that memory usage is well reported on Windows but it is incorrectly
reported on the other systems.
MitkWorkbench memory usage is reported using the function
GetProcessMemoryUsage() located at
Modules/Core/src/DataManagement/mitkMemoryUtilities.cpp.
In Windows it invokes GetProcessMemoryInfo( hProcess, &pmc,
sizeof(pmc)) and pmc.WorkingSetSize is used to read current working set
size. This is ok, see https://msdn.microsoft.com/es-es/library/window
s/
desktop/ms684877(v=vs.85).aspx.
In Linux it reads /proc/self/statm file and it gets the first number
(named size in GetProcessMemoryUsage) in that file. That number
corresponds to total program size. I think the second number (named res
in GetProcessMemoryUsage) should be used instead, it is the resident
set size and it corresponds to the memory usage shown in monitoring
apps. See /proc/[pid]/statm in http://man7.org/linux/man-pages/man5/p
ro
c.5.html.
In Mac the virtual_size field of the task_basic_info structure is used.
I think the field resident_size should be used instead. See
task_info()
 in http://nadeausoftware.com/articles/2012/07/c_c_tip_how_get_proces
s_
resident_set_size_physical_memory_use#taskinfoforcurrentresidentsetsi
ze
.
Regards,
Jose Manuel
--
,.....................................,..............................
..,
: Dpto. de Inteligencia Artificial    : Tel:  (+34) 91-398-
: Univ. Nac. de Educacion a Distancia : Fax:  (+34) 91-398-
: Juan del Rosal, 16 -
: E-28040 Madrid       SPAIN          : http://www.ia.uned.es/~jmcuad
'.....................................:..............................
..'
-------------------------------------------------------------------
-----------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
https://lists.sourceforge.net/lists/listinfo/mitk-users
--
,.....................................,................................,
: Jose Manuel Cuadra Troncoso : Email: ***@dia.uned.es :
: Dpto. de Inteligencia Artificial : Tel: (+34) 91-398-7144 :
: Univ. Nac. de Educacion a Distancia : Fax: (+34) 91-398-9382 :
: Juan del Rosal, 16 - 3ª : :
: E-28040 Madrid SPAIN : http://www.ia.uned.es/~jmcuadra:
'.....................................:................................'
Loading...