Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[VxW] RE: Load/Unload problem - reg

156 views
Skip to first unread message

GANESH KUMAR MURUGESAN

unread,
Apr 30, 2003, 12:24:13 AM4/30/03
to vxwe...@csg.lbl.gov

Hi
This is in continuation to my yesterday's mail. Today I again conducted
the same testing, but with out the step number 3. The test results were
exactly same. I would also like to know if vxWorks will take care of
freeing all the memory (including run-time) allocated by a module after
that module gets unloaded.

Regards
Ganesh

-----Original Message-----
From: GANESH KUMAR MURUGESAN
Sent: Tuesday, April 29, 2003 8:30 PM
To: 'vxwe...@csg.lbl.gov'
Subject: Load/Unload problem - reg


Hi all,
This is regarding loading and unloading the ".o"s in vxWorks. I have
observed that the vxWorks doesn't do a complete clean-up after I have
unloaded a ".o". I got the details about the memory statistics in my
test system by using "memShow".

Here is what I did:

1. Run memShow & collect the statistics.
2. Load a ".o"
3. Run the module by invoking the init of that module.
4. Run memShow & collect the memory statistics.
5. unload the ".o".
6. Run the memShow & collect the statistics.

The values obtained in step 1 & step 6 is expected to be same, but it
was not. There was a significant difference. I would like to know if
"unld" is safe to use or not.

Regards
Ganesh

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.

***************************************************************************

Lori Fraleigh

unread,
Apr 30, 2003, 1:29:59 AM4/30/03
to VxWorks Users Group List, ganesh.m...@wipro.com

Ganesh -

Are you doing this from the host-based WindShell or from a
target-based shell? How much memory are you "losing"?

What specific commands do you issue to load and unload the module?
If you cd to a directory before loading the module or pass a
string to ld from the target shell, the target will need
to allocate memory for the string.

What type of code is in the module? C, C++, Ada, something else?

Unless you're using VxWorks AE, there is not automatic
resource reclamation. Simply unloading a module will not
free any run-time memory allocated by code within that module.

Regards,
Lori

> _______________________________________________
> VxWorks Users Group mailing list
> VxWe...@lbl.gov
> http://www-csg.lbl.gov/vxworks/


--
Lori Fraleigh Director of Engineering
Real-Time Innovations, Inc. http://www.rti.com
Phone: 408-734-4200 x121 Fax: 408-734-5009


Kashif Haidery

unread,
Apr 30, 2003, 2:08:26 AM4/30/03
to VxWorks Users Group List
I think, the very reason that Joe had in mind was that your module was not
freeing up the runtime memory resources effectively, when suggested this
procedure, normally I don't think the vxworks frees the memory resources
used during runtime. From my idea of the loader, the unld function simply
marks the used memory portions as 'bad' on the target, enabling them to be
rewritten(which actually should enable the memory to show up as free, in
memShow..or any other routines), also if you re-download the same module,
without unloading it, Vxworks should overwrite the memory space that was
taken up initially.

Joe Durusau

unread,
Apr 30, 2003, 7:46:13 AM4/30/03
to

Well, the man page for the unld function says that it frees the
text, bss, and data segments, _unless_ the module was loaded at a
specific address, in which no freeing of memory takes place. If you
have some C++ code that does some memory allocation "automagically"
when a module loads, then unld will not reverse the situation. It will
also not free semaphores, not undo any memory allocation specifically
done by the object code itself. I suspect that if the module were a
C module it would work, but I've never had a reason to use loading and
unloading, as in more traditional real-time systems, one never uses
dynamic memory allocation at all.

Speaking only for myself,

Joe Durusau

0 new messages