Sponsored Content
Top Forums Programming How to decrease virtual size of a process after cleaning all containers and using malloc_trim (0)? Post 302937983 by umen on Wednesday 11th of March 2015 06:43:39 AM
Old 03-11-2015
How to decrease virtual size of a process after cleaning all containers and using malloc_trim (0)?

Hello all
i have simple server running on linux redhat 6.1
it is build with c++
in the server i have huge std vector that holds pointers to cache objects
those cache objects holds allot of data from the DB
any way ...
in some point in time there is simple API that suppose to clean the vector
i do simple iteration over the std vector and delete the object pointers and in the end i also clean() the vector
and after all of this i execute : malloc_trim (0) that returns 1
the problem is that the virtual size of a process never decrease
BUT only the resident size do decrease fine .
the big problem when i like to load the cache again , the virtual size of a process get doubled .

how do i decrease virtual size of a process in c++/c ?
thanks
 

10 More Discussions You Might Find Interesting

1. Programming

Will exe file size decrease while using inline function

using namespace std; void g(); class A { public : A() { g();g();g(); cout << "Constructor of A"<< endl ;} }; inline void g(){ cout << "vijay" <<endl; } int main() { A a; } when i use inline i get size 303488 Aug 31 12:05 a.out* when not using inline i get size 303572 Aug 31... (1 Reply)
Discussion started by: vijaysabari
1 Replies

2. UNIX for Dummies Questions & Answers

how can i get The total size of the process in virtual memory om GB or MB

Hello all im using the ps -ef "args vsz" | some.exe but the result is in kb , is there some kind of way or flag ( didnt found in the ps man ) to convert me this data to GB or MG in human readable format ? Thanks (1 Reply)
Discussion started by: umen
1 Replies

3. UNIX for Dummies Questions & Answers

how to Decrease priority of a particular process in time of process creation

how to decrease priority of a particular process in time of process creation... and also how to decrease priority of a particular process after process creation.. can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies

4. Shell Programming and Scripting

How to decrease the font size in Mailx

Hi all, I am using echo "$EMAILMESSAGE" | mailx -s "$SUBJECT" -b $CC "$TO" I am receiving the mail but seems to big in font size. Is there any option mailx to decrease the size of the mail generated. Thanks, (1 Reply)
Discussion started by: shellscripter
1 Replies

5. Programming

Find Virtual address space size for process

Hi, I am looking to work on unix systems which include (hp-ux, ibm aix, solaris and linux). I want to get the total virtual address space of a process, the used virtual memory i am able to get without any problem. I have tried using getrlimit and getrlimit64, but that gives only ... (4 Replies)
Discussion started by: uiqbal
4 Replies

6. UNIX for Advanced & Expert Users

Process self-exec and virtual memory size

Hello all, To do a self-exec or self-restart of a process when it crosses the threshold memory limit, I use the value of virtual memory size field from /proc/$pid/stat file and do a self-exec. According to man 5 proc vsize %lu Virtual memory size in bytes. I just want to... (2 Replies)
Discussion started by: matrixmadhan
2 Replies

7. AIX

Why using "%" of Paging size increases & how to decrease this percentage?

Hi I have found a problem on my AIX 5.1 server. day by day the paging size is increasing,what is the reason behind it and if percentage is at 100 what will happen. Oracle 9i is running on my server. PAGING SPACE size,mb 5632 % used 14.6 % free 85.3 How can i decrease the using... (6 Replies)
Discussion started by: dearsumon
6 Replies

8. Fedora

How to increase/Decrease Local Virtual consoles?

I m tring to figure out the option where i can increase/Decrease the count for local virtual consoles(vtys). I can able to take upto 6 vtys using (left alt+(F1-F6)) But is there any way i can increase the count ? One more query even though i can only take tty upto tty6 why there are tty... (2 Replies)
Discussion started by: pinga123
2 Replies

9. UNIX for Dummies Questions & Answers

Decrease buffer size

Hi, I am using the below command to get the output in a file called "Logs.txt" tail -f filename | egrep -i "cpu | hung " >> Logs.txt The problem is the Logs.txt file gets updated only after the buffer is 8Kb, but i want to update the file immediately and not wait for the buffer to get 8kb. Is... (8 Replies)
Discussion started by: @bhi
8 Replies

10. AIX

[ASK] decrease/shrink the size of filesystem

Hello, I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease? This is not an issue, just a discussion for decrease/shrink space with chfs command. My AIX system is version 6.1 and the filesystem... (2 Replies)
Discussion started by: Phat
2 Replies
QPtrVector(3qt) 														   QPtrVector(3qt)

NAME
QPtrVector - Template collection class that provides a vector (array) SYNOPSIS
#include <qptrvector.h> Inherits QPtrCollection. Public Members QPtrVector () QPtrVector ( uint size ) QPtrVector ( const QPtrVector<type> & v ) ~QPtrVector () QPtrVector<type> & operator= ( const QPtrVector<type> & v ) bool operator== ( const QPtrVector<type> & v ) const type ** data () const uint size () const virtual uint count () const bool isEmpty () const bool isNull () const bool resize ( uint size ) bool insert ( uint i, const type * d ) bool remove ( uint i ) type * take ( uint i ) virtual void clear () bool fill ( const type * d, int size = -1 ) void sort () int bsearch ( const type * d ) const int findRef ( const type * d, uint i = 0 ) const int find ( const type * d, uint i = 0 ) const uint containsRef ( const type * d ) const uint contains ( const type * d ) const type * operator[] ( int i ) const type * at ( uint i ) const Important Inherited Members bool autoDelete () const void setAutoDelete ( bool enable ) Protected Members virtual int compareItems ( QPtrCollection::Item d1, QPtrCollection::Item d2 ) virtual QDataStream & read ( QDataStream & s, QPtrCollection::Item & item ) virtual QDataStream & write ( QDataStream & s, QPtrCollection::Item item ) const DESCRIPTION
The QPtrVector class is a template collection class that provides a vector (array). QValueVector is an STL-compatible alternative to this class. QPtrVector is implemented as a template class. Defines a template instance QPtrVector<X> to create a vector that contains pointers to X (X*). A vector is the same as an array. The main difference between QPtrVector and QMemArray is that QPtrVector stores pointers to the elements, whereas QMemArray stores the elements themselves (i.e. QMemArray is value-based and QPtrVector is pointer-based). Items are added to the vector using insert() or fill(). Items are removed with remove(). You can get a pointer to an item at a particular index position using at(). Unless otherwise stated, all functions that remove items from the vector will also delete the element pointed to if auto-deletion is enabled. By default, auto-deletion is disabled; see setAutoDelete(). This behaviour can be changed in a subclass by reimplementing the virtual function deleteItem(). Functions that compare items (find() and sort() for example) will do so using the virtual function compareItems(). The default implementation of this function only compares the pointer values. Reimplement compareItems() in a subclass to get searching and sorting based on the item contents. You can perform a linear search for a pointer in the vector using findRef(), or a binary search (of a sorted vector) using bsearch(). You can count the number of times an item appears in the vector with contains() or containsRef(). See also QMemArray and Non-GUI Classes. MEMBER FUNCTION DOCUMENTATION
QPtrVector::QPtrVector () Constructs a null vector. See also isNull(). QPtrVector::QPtrVector ( uint size ) Constructs an vector with room for size items. Makes a null vector if size == 0. All size positions in the vector are initialized to 0. See also size(), resize(), and isNull(). QPtrVector::QPtrVector ( const QPtrVector<type> & v ) Constructs a copy of v. Only the pointers are copied (i.e. shallow copy). QPtrVector::~QPtrVector () Removes all items from the vector, and destroys the vector itself. See also clear(). type * QPtrVector::at ( uint i ) const Returns the item at position i, or 0 if there is no item at that position. i must be less than size(). bool QPtrCollection::autoDelete () const Returns the setting of the auto-delete option. The default is FALSE. See also setAutoDelete(). int QPtrVector::bsearch ( const type * d ) const In a sorted array, finds the first occurrence of d using a binary search. For a sorted array, this is generally much faster than find(), which performs a linear search. Returns the position of d, or -1 if d could not be found. d must not be 0. Compares items using the virtual function compareItems(). See also sort() and find(). void QPtrVector::clear () [virtual] Removes all items from the vector, and destroys the vector itself. The vector becomes a null vector. See also isNull(). Reimplemented from QPtrCollection. int QPtrVector::compareItems ( QPtrCollection::Item d1, QPtrCollection::Item d2 ) [virtual protected] This virtual function compares two list items. Returns: zero if d1 == d2 nonzero if d1 != d2 This function returns int rather than bool so that reimplementations can return one of three values and use it to sort by: 0 if d1 == d2 > 0 (positive integer) if d1 > d2 < 0 (negative integer) if d1 < d2 The sort() and bsearch() functions require compareItems() to be implemented as described here. This function should not modify the vector because some const functions call compareItems(). uint QPtrVector::contains ( const type * d ) const Returns the number of occurrences of item d in the vector. Compares items using the virtual function compareItems(). See also containsRef(). uint QPtrVector::containsRef ( const type * d ) const Returns the number of occurrences of the item pointer d in the vector. This function does not use compareItems() to compare items. See also findRef(). uint QPtrVector::count () const [virtual] Returns the number of items in the vector. The vector is empty if count() == 0. See also isEmpty(), size(), and isNull(). Reimplemented from QPtrCollection. type ** QPtrVector::data () const Returns a pointer to the actual vector data, which is an array of type*. The vector is a null vector if data() == 0 (null pointer). See also isNull(). bool QPtrVector::fill ( const type * d, int size = -1 ) Inserts item d in all positions in the vector. Any existing items are removed. If d is 0, the vector becomes empty. If size >= 0, the vector is first resized to size. By default, size is -1. Returns TRUE if successful, i.e. size is the same as the current size, or size is larger and the memory has successfully been allocated; otherwise returns FALSE. See also resize(), insert(), and isEmpty(). int QPtrVector::find ( const type * d, uint i = 0 ) const Finds the first occurrence of item d in the vector using a linear search. The search starts at position i, which must be less than size(). i is by default 0; i.e. the search starts at the start of the vector. Returns the position of d, or -1 if d could not be found. Compares items using the virtual function compareItems(). Use the much faster bsearch() to search a sorted vector. See also findRef() and bsearch(). int QPtrVector::findRef ( const type * d, uint i = 0 ) const Finds the first occurrence of the item pointer d in the vector using a linear search. The search starts at position i, which must be less than size(). i is by default 0; i.e. the search starts at the start of the vector. Returns the position of d, or -1 if d could not be found. This function does not use compareItems() to compare items. Use the much faster bsearch() to search a sorted vector. See also find() and bsearch(). bool QPtrVector::insert ( uint i, const type * d ) Sets position i in the vector to contain the item d. i must be less than size(). Any previous element in position i is removed. See also at(). bool QPtrVector::isEmpty () const Returns TRUE if the vector is empty; otherwise returns FALSE. See also count(). bool QPtrVector::isNull () const Returns TRUE if the vector is null; otherwise returns FALSE. A null vector has size() == 0 and data() == 0. See also size(). QPtrVector<;type> & QPtrVector::operator= ( const QPtrVector<type> & v ) Assigns v to this vector and returns a reference to this vector. This vector is first cleared and then all the items from v are copied into the vector. Only the pointers are copied (i.e. shallow copy). See also clear(). bool QPtrVector::operator== ( const QPtrVector<type> & v ) const Returns TRUE if this vector and v are equal; otherwise returns FALSE. type * QPtrVector::operator[] ( int i ) const Returns the item at position i, or 0 if there is no item at that position. i must be less than size(). Equivalent to at( i ). See also at(). QDataStream &; QPtrVector::read ( QDataStream & s, QPtrCollection::Item & item ) [virtual protected] Reads a vector item, item, from the stream s and returns a reference to the stream. The default implementation sets item to 0. See also write(). bool QPtrVector::remove ( uint i ) Removes the item at position i in the vector, if there is one. i must be less than size(). Returns TRUE if i is within range; otherwise returns FALSE. See also take() and at(). bool QPtrVector::resize ( uint size ) Resizes (expands or shrinks) the vector to size elements. The vector becomes a null vector if size == 0. Any items at position size or beyond in the vector are removed. New positions are initialized to 0. Returns TRUE if successful, i.e. if the memory was successfully allocated; otherwise returns FALSE. See also size() and isNull(). void QPtrCollection::setAutoDelete ( bool enable ) Sets the collection to auto-delete its contents if enable is TRUE and to never delete them if enable is FALSE. If auto-deleting is turned on, all the items in a collection are deleted when the collection itself is deleted. This is convenient if the collection has the only pointer to the items. The default setting is FALSE, for safety. If you turn it on, be careful about copying the collection - you might find yourself with two collections deleting the same items. Note that the auto-delete setting may also affect other functions in subclasses. For example, a subclass that has a remove() function will remove the item from its data structure, and if auto-delete is enabled, will also delete the item. See also autoDelete(). Examples: uint QPtrVector::size () const Returns the size of the vector, i.e. the number of vector positions. This is also the maximum number of items the vector can hold. The vector is a null vector if size() == 0. See also isNull(), resize(), and count(). void QPtrVector::sort () Sorts the items in ascending order. Any empty positions will be put last. Compares items using the virtual function compareItems(). See also bsearch(). type * QPtrVector::take ( uint i ) Returns the item at position i in the vector, and removes that item from the vector. i must be less than size(). If there is no item at position i, 0 is returned. Unlike remove(), this function does not call deleteItem() for the removed item. See also remove() and at(). QDataStream &; QPtrVector::write ( QDataStream & s, QPtrCollection::Item item ) const [virtual protected] Writes a vector item, item, to the stream s and returns a reference to the stream. The default implementation does nothing. See also read(). SEE ALSO
http://doc.trolltech.com/qptrvector.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qptrvector.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QPtrVector(3qt)
All times are GMT -4. The time now is 01:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy