Essentially leak free (mem and disk) after a few hours of roseTable

This commit is contained in:
Sears Russell 2007-11-12 07:27:49 +00:00
parent ecc2392066
commit 799c7498cd
7 changed files with 20 additions and 8 deletions

View file

@ -454,9 +454,7 @@ class versioningIterator {
it_ = i.it_; it_ = i.it_;
itend_ = i.itend_; itend_ = i.itend_;
} }
// inline unsigned int offset() { return off_; }
private: private:
// unsigned int off_;
STLITER it_; STLITER it_;
STLITER itend_; STLITER itend_;
friend const byte* friend const byte*

View file

@ -62,6 +62,7 @@ namespace rose {
} }
pageCount++; pageCount++;
stasis_page_cleanup(p);
typename PAGELAYOUT::FMT * mc = PAGELAYOUT::initPage(p, &**begin); typename PAGELAYOUT::FMT * mc = PAGELAYOUT::initPage(p, &**begin);
for(ITER i(*begin); i != *end; ++i) { for(ITER i(*begin); i != *end; ++i) {
@ -236,8 +237,17 @@ namespace rose {
// TlsmFree(xid, ((typename ITERB::handle)old_in_tree)->r_,TlsmRegionDeallocRid,a->in_tree_allocer); // TlsmFree(xid, ((typename ITERB::handle)old_in_tree)->r_,TlsmRegionDeallocRid,a->in_tree_allocer);
// XXX kludge; assumes C1 and C2 have same type of handle.... // XXX kludge; assumes C1 and C2 have same type of handle....
TlsmFree(xid, ((typename ITERA::handle)old_in_tree)->r_,TlsmRegionDeallocRid,a->in_tree_allocer); TlsmFree(xid, ((typename ITERA::handle)old_in_tree)->r_,TlsmRegionDeallocRid,a->in_tree_allocer);
}
delete old_in_tree; delete old_in_tree;
} else {
((typename stlSetIterator<std::set<typename PAGELAYOUT::FMT::TUP,
typename PAGELAYOUT::FMT::TUP::stl_cmp>,
typename PAGELAYOUT::FMT::TUP>::handle)old_in_tree)->clear();
delete
((typename stlSetIterator<std::set<typename PAGELAYOUT::FMT::TUP,
typename PAGELAYOUT::FMT::TUP::stl_cmp>,
typename PAGELAYOUT::FMT::TUP>::handle)old_in_tree);
}
free(*a->in_tree); // free pointer to handle free(*a->in_tree); // free pointer to handle
// XXX should we delay this to this point? // XXX should we delay this to this point?
@ -526,6 +536,7 @@ namespace rose {
template<class PAGELAYOUT> template<class PAGELAYOUT>
void TlsmTableStop( lsmTableHandle<PAGELAYOUT> * h) { void TlsmTableStop( lsmTableHandle<PAGELAYOUT> * h) {
TlsmTableFlush(h); TlsmTableFlush(h);
delete(h->scratch_handle);
*(h->still_open) = 0; *(h->still_open) = 0;
pthread_join(h->merge1_thread,0); pthread_join(h->merge1_thread,0);
pthread_join(h->merge2_thread,0); pthread_join(h->merge2_thread,0);

View file

@ -97,7 +97,7 @@ class StaticMulticolumn {
exceptions_(new byte[USABLE_SIZE_OF_PAGE]), exceptions_(new byte[USABLE_SIZE_OF_PAGE]),
unpacked_(1) unpacked_(1)
{ {
stasis_page_cleanup(p);
*column_count_ptr() = N; *column_count_ptr() = N;
bytes_left_ = first_header_byte_ptr()- p->memAddr; bytes_left_ = first_header_byte_ptr()- p->memAddr;
@ -501,7 +501,6 @@ template <int N, class TUPLE,
class COMP0, class COMP1, class COMP2, class COMP3, class COMP4, class COMP0, class COMP1, class COMP2, class COMP3, class COMP4,
class COMP5, class COMP6, class COMP7, class COMP8, class COMP9> class COMP5, class COMP6, class COMP7, class COMP8, class COMP9>
static void staticMulticolumnCleanup(Page *p) { static void staticMulticolumnCleanup(Page *p) {
// printf("cleanup %d\n", N); fflush(stdout);
delete (StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>*)p->impl; delete (StaticMulticolumn<N,TUPLE,COMP0,COMP1,COMP2,COMP3,COMP4,COMP5,COMP6,COMP7,COMP8,COMP9>*)p->impl;
p->impl = 0; p->impl = 0;
} }

View file

@ -14,6 +14,7 @@ void stasis_fixed_initialize_page(Page * page, size_t size, int count) {
assertlocked(page->rwlatch); assertlocked(page->rwlatch);
// XXX fixed page asserts it's been given an UNINITIALIZED_PAGE... Why doesn't that crash? // XXX fixed page asserts it's been given an UNINITIALIZED_PAGE... Why doesn't that crash?
// assert(*stasis_page_type_ptr(page) == UNINITIALIZED_PAGE); // assert(*stasis_page_type_ptr(page) == UNINITIALIZED_PAGE);
stasis_page_cleanup(page);
*stasis_page_type_ptr(page) = FIXED_PAGE; *stasis_page_type_ptr(page) = FIXED_PAGE;
*recordsize_ptr(page) = size; *recordsize_ptr(page) = size;
assert(count <= stasis_fixed_records_per_page(size)); assert(count <= stasis_fixed_records_per_page(size));

View file

@ -15,6 +15,7 @@ int headerPageInitialize() {
if(*page_type_ptr(p) != LLADD_HEADER_PAGE) { if(*page_type_ptr(p) != LLADD_HEADER_PAGE) {
assert(*page_type_ptr(p) == 0) ; assert(*page_type_ptr(p) == 0) ;
memset(p->memAddr, 0, PAGE_SIZE); memset(p->memAddr, 0, PAGE_SIZE);
stasis_page_cleanup(p);
*page_type_ptr(p) = LLADD_HEADER_PAGE; *page_type_ptr(p) = LLADD_HEADER_PAGE;
*headerFreepage_ptr(p) = 1; *headerFreepage_ptr(p) = 1;
*headerFreepagelist_ptr(p) = 0; *headerFreepagelist_ptr(p) = 0;

View file

@ -10,6 +10,7 @@
void indirectInitialize(Page * p, int height) { void indirectInitialize(Page * p, int height) {
*level_ptr(p) = height; *level_ptr(p) = height;
stasis_page_cleanup(p);
*stasis_page_type_ptr(p) = INDIRECT_PAGE; *stasis_page_type_ptr(p) = INDIRECT_PAGE;
memset(p->memAddr, INVALID_SLOT, ((size_t)level_ptr(p)) - ((size_t)p->memAddr)); memset(p->memAddr, INVALID_SLOT, ((size_t)level_ptr(p)) - ((size_t)p->memAddr));
} }

View file

@ -195,6 +195,7 @@ void slottedPageDeinit() {
void stasis_slotted_initialize_page(Page * page) { void stasis_slotted_initialize_page(Page * page) {
assertlocked(page->rwlatch); assertlocked(page->rwlatch);
stasis_page_cleanup(page);
*stasis_page_type_ptr(page) = SLOTTED_PAGE; *stasis_page_type_ptr(page) = SLOTTED_PAGE;
*freespace_ptr(page) = 0; *freespace_ptr(page) = 0;
*numslots_ptr(page) = 0; *numslots_ptr(page) = 0;