Skip to content

Commit

Permalink
TST: estimate memory usage for subset
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Nov 3, 2022
1 parent ccf7a40 commit ef050a2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@
<b>WARNING</b>: Computing and displaying raw profile of an aperture containing ~{{subset_area}} pixels may be slow or unresponsive.
</span>
</v-row>
<v-row v-if="current_plot_type==='Radial Profile (Raw)'">
<span class="v-messages v-messages__message text--secondary">
Estimated remaining memory usage: {{predictedMemoryUsagePerc(subset_area).toPrecision(2)}}%
</span>
</v-row>


<v-row v-if="current_plot_type.indexOf('Radial Profile') != -1">

Expand Down Expand Up @@ -176,3 +182,16 @@
</div>
</j-tray-plugin>
</template>

<script>
module.exports = {
methods: {
predictedMemoryUsagePerc(npoints) {
const slope = 8500
const memory = performance.memory
return slope * npoints / (memory.jsHeapSizeLimit - memory.totalJSHeapSize) * 100
},
},
};
</script>

0 comments on commit ef050a2

Please sign in to comment.