Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (trivial) leak in xgboost_regrank #16

Merged
merged 1 commit into from Jul 12, 2014
Merged

Conversation

smly
Copy link
Contributor

@smly smly commented Jul 12, 2014

Hello.

I fixed trivial leak in RegRankBoostLearner.
This PR may help users who uses xgboost as a library, but for many this is not important.
After running valgrind, I got these leaks:

$ valgrind --leak-check=full ../../xgboost mq2008.conf

(snip)

build GBRT with 9630 instances
tree train end, 1 roots, 118 extra nodes, 0 pruned nodes ,max_depth=6
[3]     test-map:0.493151

updating end, 6 sec in all
==68506==
==68506== HEAP SUMMARY:
==68506==     in use at exit: 29,803 bytes in 380 blocks
==68506==   total heap usage: 965 allocs, 585 frees, 5,534,747 bytes allocated
==68506==
==68506== 24 bytes in 1 blocks are definitely lost in loss record 19 of 79
==68506==    at 0x6DFB: malloc (in /usr/local/Cellar/valgrind/3.9.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==68506==    by 0x6E28D: operator new(unsigned long) (in /usr/lib/libc++.1.dylib)
==68506==    by 0x10001650D: xgboost::regrank::CreateObjFunction(char const*) (in ../../xgboost)
==68506==    by 0x1000162BA: xgboost::regrank::RegRankBoostLearner::InitTrainer() (in ../../xgboost)
==68506==    by 0x100002750: xgboost::regrank::RegBoostTask::InitLearner() (in ../../xgboost)
==68506==    by 0x10000095C: xgboost::regrank::RegBoostTask::Run(int, char**) (in ../../xgboost)
==68506==    by 0x100000777: main (in ../../xgboost)
==68506==
==68506== LEAK SUMMARY:
==68506==    definitely lost: 24 bytes in 1 blocks
==68506==    indirectly lost: 0 bytes in 0 blocks
==68506==      possibly lost: 0 bytes in 0 blocks
==68506==    still reachable: 4,244 bytes in 4 blocks
==68506==         suppressed: 25,535 bytes in 375 blocks
==68506== Reachable blocks (those to which a pointer was found) are not shown.
==68506== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==68506==
==68506== For counts of detected and suppressed errors, rerun with: -v
==68506== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 237 from 80)

Thanks.

tqchen added a commit that referenced this pull request Jul 12, 2014
fix (trivial) leak in xgboost_regrank, Thanks for the fix
@tqchen tqchen merged commit a83a209 into dmlc:master Jul 12, 2014
@tqchen
Copy link
Member

tqchen commented Jul 12, 2014

Thanks for the fix!

tqchen added a commit that referenced this pull request Sep 6, 2014
fix (trivial) leak in xgboost_regrank, Thanks for the fix
tqchen added a commit that referenced this pull request Sep 7, 2014
fix (trivial) leak in xgboost_regrank, Thanks for the fix
tqchen added a commit that referenced this pull request Sep 7, 2014
fix (trivial) leak in xgboost_regrank, Thanks for the fix
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants