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

space complexity 측정 #4

Open
engyengKim opened this issue Jun 10, 2018 · 2 comments
Open

space complexity 측정 #4

engyengKim opened this issue Jun 10, 2018 · 2 comments

Comments

@engyengKim
Copy link
Contributor

space complexity 측정할때 일단은 해당 클래스의 가장 큰 멤버변수 사이즈를 측정하도록 설정했는데, 이게 맞는건지 잘 모르겠습니다....ㅠㅠ

@KooYS
Copy link
Collaborator

KooYS commented Jun 10, 2018

그 클래스에서 implementation하는 부분에서 할당되는 메모리의 크기를 측정하면될거같아요 . c++에서는 sizeof가 있는데 java에는 그 부분이 없어서 저는 메모리 힙영역을 계산했거든요? 저도 이게 교수님께서 원하시는 답인지는 모르겠지만 저는 이렇게 했습니다.

@KooYS
Copy link
Collaborator

KooYS commented Jun 10, 2018

http://knight76.tistory.com/entry/How-to-get-object-size-in-java 여기 링크를 보시면 제가 한 거 말고 다른 방법으로 object의 size를 측정하는 방법이 있는데 jar을 만들고 또 추가하고 여러 작업을 해야하더라구요 저도 이부분은 잘 모르겠어서 전자의 방법으로 했습니다. 여유가 되시면 위의 링크를 한번 해보시는것도 괜찮은것 같아요!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants